Is there anyone know how to read other sites' html source to a string? I tried file() and readfile(). They doesn't really work.
Lets see......
Try this:
<? function httpstring($url) { $pagestring = ''; $pagearray = file($url); for ($i = 0; $i < count($pagearray); $i++) { $pagestring .= $pagearray[$i]; } return $pagestring; }
//Now we print yahoo: echo httpstring('http://www.yahoo.com'); ?>
Hi,
you can also use following:
$url = "http://www.phpbuilder.com/"; $contents = join('', file($url));
firemouse2001
Yeah, I forgot about that. Thanks, firemouse!