How can I get the "$buffer" value into a string, and use it outside the fopen and fclose functions? Thanks.
$handle = @fopen("http://www.example.com/", "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgetss($handle, 5000);
echo $buffer ;
}
fclose($handle);
}
fgetss
is kind of useless. It will incorrectly strip_tags when they run over line breaks. So use one of thefile_get_contents
answers and applystrip_tags
afterwards. – mario