求大神指教如何修改下面的这段代码的执行时间频率啊?这段代码好像是利用死循环、来不断执行的、还有这段代码执行以后貌似停止不了!求大神解答啊!
<?php
date_default_timezone_set("PRC");
ignore_user_abort(true);
set_time_limit(0); //设置程序执行时间无限制
$lxt=$_GET['lxt'];
$bid=$_GET['bid'];
while(true){
$geturl="
http://f2.lexun.com/list.aspx?orders=7&bid={$bid}&cd=103&lxt={$lxt}&vs=0";
$getdate=file_get_contents($geturl);
$end=strpos($getdate,"强贴");
$getnew=substr($getdate,$end,100);
preg_match("/\?id=(\d+)/",$getnew,$id2);
$id=$id2['1'];
$getid=file_get_contents($lxt);
if(trim($getid)!=$id){
$txt=file('reply.txt');
shuffle($txt);
#要提交的数据串
$postdata="content=$txt[2]&id=$id&1b52a2a1d=c97b7828b&reference=11117&rand=14382";
#要提交到的网址
$URL="
http://f5.lexun.com/writerlyapp.aspx?gorders=1&gpage=1&npp=1&bid=".$bid."&pl=1&cd=0&lxt=".$lxt."&vs=0";
$ch=curl_init();
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata);
#打开缓存写入数据
ob_start();
curl_exec($ch);
$result=ob_get_contents();
#关闭缓存
ob_end_clean();
file_put_contents($lxt,$id);
unset($getid);
}
file_put_contents('runtime.txt',date("Y-m-d H:i:s"));
sleep(30);
}
?>