STFW


Зарегистрирован: Jul 2002
Место проживания: Кольский п-ов
Публикаций: 305
Статус:  |
http://www.php.net/manual/en/function.fread.php
quote:
Warning
When reading from network streams or pipes, such as those returned when reading remote files or from popen() and fsockopen(), reading will stop after a packet is available. This means that you should collect the data together in chunks as shown in the example below.
PHP:
<?php
$handle = fopen("http://www.example.com/", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>
Note: If you just want to get the contents of a file into a string, use file_get_contents() as it has much better performance than the code above.
__________________
FAQ OFF
Сообщить модератору об этом сообщении | Предупреждение | IP: определен
|