Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2005, 09:14 AM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default strip html from spider script results

I have a script that spiders a news site and grabs the html and displays it. Yes, I do have permission for this! I want to be able to strip everything, outside of the <body></body> tags and only display what is inside the body tags. below is the current code I'm using...

Code:
<?php
    $url = "http://www.genericmetalnews.com/";
    $fp = fopen($url, 'rb');

    while(($data = fgets($fp, 1024)) !== false)
    {
        echo $data;
    }
    fclose($fp);
?>





Similar Threads
Thread Thread Starter Forum Replies Last Post
strip html tags with xslt smiter XSLT 4 June 19th, 2012 08:34 AM
results in view source but not on html page monstermash Classic ASP Basics 25 July 9th, 2007 02:22 AM
Strip HTML with ASP Question ryanpatrick Classic ASP Professional 1 January 17th, 2005 08:15 AM
Getting results from Select Multiple HTML tag dpjoff PHP How-To 9 February 2nd, 2004 04:03 PM
strip html tags & PHP trangd Beginning PHP 6 October 21st, 2003 10:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.