![]() |
Показаны 2 сообщений на этой странице |
Форум сетевых администраторов (http://netadmin.ws/forum/index.php)
- PHP (http://netadmin.ws/forum/forumdisplay.php?forumid=6)
-- еще раз к вопросу о граббере (http://netadmin.ws/forum/showthread.php?threadid=8650)
еще раз к вопросу о граббере
следующая конструкция
<?
$fd= fread(fopen("http://ishim.info", "r"), 100000);
if ($fd)
{
$start= strpos($fd, "<html>");
$finish= strpos($fd, "<\/html>");
$length= $finish-$start;
$code=Substr($fd, $start, $length);
}
echo $code;
?>
результат
у меня возникает ощущение что есть какой то таймаут, потому как виден лишь кусок страницы .... проверял на двух хостингах.
многие говорят что работать должно без проблем....
в чем ошибка?
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
$handle = fopen("http://www.example.com/", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>
__________________
FAQ OFF
| Формат времени GMT. Текущее время 12:54. | Показаны 2 сообщений на этой странице |
Powered by: vBulletin Version 2.2.4
Copyright © Jelsoft Enterprises Limited 2000, 2001.