Oops... 

// $htlm should have been $html

preg_match('/<title>(.*)<\/title>/Usi', $html, $title);

Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, 10 January 2003 3:22 PM
> To: 'Martin Hudec'; [EMAIL PROTECTED]
> Subject: RE: [PHP] searching for string inside document
> 
> 
> 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: [EMAIL PROTECTED]
> 
> > -----Original Message-----
> > From: Martin Hudec [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, 10 January 2003 3:22 PM
> > To: [EMAIL PROTECTED]
> > 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   [EMAIL PROTECTED]
> >                                  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
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to