我在获取一远程文件
用的是
$gather_url = "http://0791.8ff.cn/";
$html = @file_get_contents($gather_url);
可会超时,每回都不能取全部数据,可能是超时的问题,
请问怎么样才能取到全部数据,多谢

解决方案 »

  1.   

    php.ini 设置最大执行时间=0
      

  2.   

    加一个这个
    set_time_limit( 0 );
      

  3.   

      while (!$content=@file_get_contents($url)){
       $count++;
       if($count==100){  
         break;
      echo "<br>Cant't get the ======$url=====  file";
      exit;
        }
      }写个计数,取100次,呵呵
      

  4.   

    没有超时,是insert db时主键重了,多谢大家