Re: stripping <title>Title</title> from page?

From: Date: Mon, 11 Dec 2000 22:43:34 +0000
Subject: Re: stripping <title>Title</title> from page?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29761@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Wouldn't it be better to write: function inString($start, $end,$string) { eregi($start."(.*)".$end,$string,$result); return($result[0]); } Just a thought anyway. Patrick Q-G. - ----- Original Message ----- From: "Yoeri De Bruyn" <yoeri_de_bruyn@multicap.be> To: "phpGeneralList" <php-general@lists.php.net> Sent: Tuesday, December 12, 2000 4:29 AM Subject: [PHP] stripping <title>Title</title> from page? > Hi, > > I want to retrieve the title from every page of my website, put it > together with the URL of the page in a MySql database to setup a > search engine. > > Next code is not very ecological (it takes about 30" to parse one > html page)!!! > Anybody a briliant clue on how I should tune this one? > > Thanks a lot for any handy trick! > Yoeri. > > <?php > > function inString($start, $end,$string) > { > eregi(".*".$start."(.*)".$end.".*",$string,$result); > return($result[1]); > } > > $pageContent=implode(' ', file('test.html')); > $title=inString("<title>","</title>",$pageContent); > > echo($title); > ?> > > > > > > > -- > 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 > -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com> iQA/AwUBOjSv1u5gPjuO7VwfEQIkTACgl1HeKu97ysCKRwKhr2q8ghpOHO0AoJgi vTl2oMNhmXcP9VSV57p2sGk8 =CvNx -----END PGP SIGNATURE-----

« previous php.general (#29761) next »