cool thanks
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
Reply-To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Didier McGillis" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: Re: [PHP] hopefully easy
Date: Wed, 29 Jan 2003 08:58:50 -0500
> 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.
preg_match("!<title>(.*)</title>!si",$html,$match);
echo $match[1];
That will account for <title> vs <TITLE> and also if <title> and </title>
are on separate lines. You may have to add a U modifier if there is a chance
</title> would be somewhere else in the text, although I don't know why it
would be...
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php