RE: [PHP] searching for string inside document
| From: | Timothy Hitchens \(HiTCHO\) | Date: | Fri, 10 Jan 2003 05:21:30 +0000 |
| Subject: | RE: [PHP] searching for string inside document | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131046@lists.php.net to get a copy of this message | ||
Use Preg:
// put your html into $html
preg_match('/<title>(.*)<\/title>/Usi', $htlm, $title);
echo $title[1];
** very basic example
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim@hitcho.com.au
> -----Original Message-----
> From: Martin Hudec [mailto:corwin@corwin.sk]
> Sent: Friday, 10 January 2003 3:22 PM
> To: php-general@lists.php.net
> Subject: [PHP] searching for string inside document
>
>
> Hello,
>
> i have document in html and i want to get out string between
> <title> tags to put it into another variable..
>
> i am wondering if i could use eregi() here....but how? I cant
> figure out any possible way... same with strchr() and strstr()
>
> can anyone help me please?
>
> --
> Best regards,
> Martin mail corwin@corwin.sk
> mobile +421.907.303.393
> icq 34358414
> www http://www.corwin.sk
>
> PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033
>
> "In those days spirits were brave, the stakes were high,
> men were real men, women were real women and small furry
> creatures from Alpha Centauri were real small furry creatures
> from Alpha Centauri."
>
> by Douglas Adams
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>