RE: [PHP] Parse HTML Block
| From: | Thor M. Steindorsson | Date: | Tue, 13 Feb 2001 02:50:50 +0000 |
| Subject: | RE: [PHP] Parse HTML Block | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39314@lists.php.net to get a copy of this message | ||
This should do the trick.
<?
$file = fopen("filename.html", "r"); //it can also be a URL
$readfile = fread($file, 20000);
$read = eregi("<something>(.*)</something>", $readfile, $output);
fclose($file);
echo $output[1];
?>
cheers,
Thor.
-----Original Message-----
From: Mark Green [mailto:mark.green@dingoblue.com.au]
Sent: Monday, February 12, 2001 6:06 PM
To: PHP General Mailing List
Subject: [PHP] Parse HTML Block
Hi Guys,
Im looking for a way to parse a value from between two tags
<something>This is what i want to return</something>
Basically its simply a block of HTML from within a large HTML file.
Speed is definately a consideration in any solution.
Any ideas?
Cheers,
Mark
--
<< If I was a signature file, where would I be?? >>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net