脚本-php的函数file_get_contents提取URL网页内容
脚本phphtml函数用file_get_contents和file_get_contents两个函数想抓取电影天堂的资源内容,但是每次抓了几个网页就停止加载了,这是为什么?
$num=91906;
while($num<95605)
{
$url="http://www.dy2018.com/i/".$num.".html";
$html=file_get_contents($url);
file_put_contents('./movie/'.$num.'.html', $html);
$num++;
}
?>
PHP之友评论