Loans - Ringtones - Myspace Layouts - Debt Help - Buy PSP

PDA

View Full Version : Checking title of 10 URL's


imnajam
Feb 19th 2008, 3:46 am
Hi,

I have a textbos in which I have 10 URL's, my aim is to retrieve Title information of all these 10 URL's and than store them into db.
Can anybody help me in finding a way to retrieve title of a URL ?

Thanks in advance

jayshah
Feb 19th 2008, 3:57 am
From http://www.zend.com//code/codex.php?ozid=233&single=1


<?php
function get_title_tag($chaine){
$fp = fopen ($chaine, 'r');
while (! feof ($fp)){
$contenu .= fgets ($fp, 1024);
if (stristr($contenu, '<title>' )){
break;
}
}
if (eregi("<title>(.*)</title>", $contenu, $out)) {
return $out[1];
}
else{
return false;
}
}
?>


Usage:

<?php
echo get_title_tag('http://www.zend.com');
?>


Jay

imnajam
Feb 19th 2008, 4:00 am
Excellent, this is exactly what I was looking for:)

Thank you Jay.

jayshah
Feb 19th 2008, 4:04 am
Excellent, this is exactly what I was looking for:)

Thank you Jay.

You're very welcome :)

Thanks for the rep.

Jay