This one should be easy to explain.
When I type in http:/ /google.com (without the space), here, on code call, it comes out as
Google..
whats the code to take the name of the page, not the URL?
after some thought, im gonna take a shot in the dark.
you use the readfile command to read the source of the file
then use preg match to get whatever is between the <title></title> tags
then echo it?
Tried these
PHP Code:
<?
$viewsource="http://google.com";
$lines = file("$viewsource");
foreach ($lines as $line_num => $line) {
if (stristr($lines,"<title>")){
$title2=strip_tags($lines);
Echo $title2;
}
}
?>
PHP Code:
<?
$file=fopen("http://google.com",r);
$read = fgets($file,255);
if (stristr($file,"<title>")){
$title=strip_tags($read);
}
fclose($file);
Echo $title;
?>
No luck, am I close?