当前位置:Gxlcms > PHP教程 > 脚本-php的函数file_get_contents提取URL网页内容

脚本-php的函数file_get_contents提取URL网页内容

时间:2021-07-01 10:21:17 帮助过:4人阅读

脚本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++;
}

?>

人气教程排行