Используйте функцию =
string fread (указатель на файл, длина) ;
пример =
<?php
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
?>
fread() reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: