function ReadFile($filename)
{
$fh = fopen($filename, 'r');
$theData = fread($fh, filesize($filename));
fclose($fh);
return $theData;
}
Related Posts
No related posts.
function ReadFile($filename)
{
$fh = fopen($filename, 'r');
$theData = fread($fh, filesize($filename));
fclose($fh);
return $theData;
}
No related posts.
Andrea Giammarchi 12:36 pm on June 27, 2009 Permalink |
file_get_contents, which is binary content safe ( “rb” as fopen flag otherwise ) is the “evolution” and
if(!function_exists('file_get_contents')) { function file_get_contents($s) { $r=fread($f=fopen($s,'rb'),filesize($s)); fclose($f); return $r; } }the natural fallback for 5 years older PHP installations
See you on Monday mate, so far we are apparently only two Web 2.0 developers in the list! Regards