RE: [PHP] hopefully easy
| From: | Steven Balthazor | Date: | Wed, 29 Jan 2003 14:08:59 +0000 |
| Subject: | RE: [PHP] hopefully easy | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133496@lists.php.net to get a copy of this message | ||
I have some code out of my own library which kind of does this; you probably
need to play with it to do exactly what you want:
preg_match_all("|<{$tag}[\s]*?>(.*?)</{$tag}[\s]*?>|si",$text,$matches);
print_r($matches);
Where:
$tag is the tag you are looking for
$text is the text string you are searching through
$matches are the results of the search
Cheers,
Steven Balthazor
-----Original Message-----
From: Didier McGillis [mailto:codesmoker@hotmail.com]
Sent: Wednesday, January 29, 2003 6:24 AM
To: php-general@lists.php.net
Subject: [PHP] hopefully easy
I need to parse an HTML file for certain information. Like the text between
<title></title>.
So if the html was ...
<html>
<head>
<title>The page</title>
</head>
<body>
Lots of code .................
</body>
</html>
I would just like the "The page" text.
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php