关于fopen()超时问题

来源:百度知道 编辑:UC知道 时间:2024/05/31 09:18:53
<?php

/**
* @author php100.com
* @copyright 2009
*/
$mun=536;
$url="http://www.php100.com/php_view_$mun.html";
while($mun>0){

if(!$head=fopen($url,r)){ //如果fopen()打开不成功输出"错误".$head; 但是没有输出
echo "错误".$head;
fclose($head);
}else{
echo $head."<br/>";
echo $mun."<br/>";
$mun--;
}
}
fclose($head);

?>
[/php]

如上。。。 如何能让代码继续运行而不是输出超时警告后停止脚本..........

========运行页面如下===========
Resource id #3
536
Resource id #4
535
Resource id #5
534

Warning: fopen([url]http://www.php100.com/php_view_536.html[/url]) [function.fopen]: failed to open

在程序头上加一句 set_time_limit(多少秒);

不满意的话,详见
https://forum.eviloctal.com/redirect.php?tid=32853&goto=lastpost