我做了一个php小程序,但是cpu占用过高 这个应该怎么解决呢?就是一个小说小偷http://ttkshu.comhttp://qqrom.cn这样子的总是被空间商警告说cpu占用过高如何优化呢?有没有相关的文章 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 放慢偷的速度就低了。每偷一个页sleep(1); // 书目规则 $curl = 'http://www.paoshu8.com/Html/Book/'.$cid.'/'.$bid.'/Index.shtm';//偷取地址 $pt->load($curl); $content = $pt->result('content');//获得代码 $pt_templets_bookname = $pt->steal($content,'小说','免费阅读',false,false);//$pt->steel是一个类 获取2个指定代码中间的值 $pt_templets_bookname = str_replace('《','',$pt_templets_bookname); $pt_templets_bookname = str_replace('》','',$pt_templets_bookname); $pt_templets_author = $pt->steal($content,'是作者:',',查阅',false,false); $pt_templets_showtime = $pt->steal($content,'最新更新:','|',false,false); $pt_templets_readlist = $pt->steal($content,' <div id="BookText">','<div id="End">',false,false); $pt_templets_readlist = str_replace(' </div>','',$pt_templets_readlist); if ($pt_config_reurl){ $pt_templets_readlist = preg_replace('/href="(.*).shtm"/','href="'.$pt_site_url.str_replace('<cid>',$cid,str_replace('<sid>','\\1',str_replace('<bid>',$bid,$pt_reurl_show))).'"',$pt_templets_readlist); }else{ $pt_templets_readlist = preg_replace('/href="(.*).shtm"/','href="'.$pt_site_url.$pt_file_show.'?cid='.$cid.'&bid='.$bid.'&sid=\\1"',$pt_templets_readlist); } $pt_templets_bookbid=$bid; include 'geturl.php'; // 规则结束 主要是geturl.php要贴出来的哇,这里是关键 为什么我的COOKIE这样无法使用?还有PHP一定要以这种方式编写的吗? php 如何判断为简体中文!!!! fckeditor在php中不能上传图片(红色交叉,不能解决) PHP 递归函数返回值问题 function_exists 在类中怎么用????? Class 'PDO' not found 错误 很菜的问题,大家都不要笑我啊:PHP读写文件换行问题。 将php由CGI运行方式改为Apache模块运行后,无法使用GD库 phpadmin 问题 为什么,我访问的时候出现下面的情况?谢谢. 终于接到一个大大大大单子了 php中的 RSS如何生成
// 书目规则
$curl = 'http://www.paoshu8.com/Html/Book/'.$cid.'/'.$bid.'/Index.shtm';//偷取地址
$pt->load($curl);
$content = $pt->result('content');//获得代码
$pt_templets_bookname = $pt->steal($content,'小说','免费阅读',false,false);//$pt->steel是一个类 获取2个指定代码中间的值
$pt_templets_bookname = str_replace('《','',$pt_templets_bookname);
$pt_templets_bookname = str_replace('》','',$pt_templets_bookname);
$pt_templets_author = $pt->steal($content,'是作者:',',查阅',false,false);
$pt_templets_showtime = $pt->steal($content,'最新更新:','|',false,false);
$pt_templets_readlist = $pt->steal($content,' <div id="BookText">','<div id="End">',false,false);
$pt_templets_readlist = str_replace(' </div>','',$pt_templets_readlist);
if ($pt_config_reurl){
$pt_templets_readlist = preg_replace('/href="(.*).shtm"/','href="'.$pt_site_url.str_replace('<cid>',$cid,str_replace('<sid>','\\1',str_replace('<bid>',$bid,$pt_reurl_show))).'"',$pt_templets_readlist);
}else{
$pt_templets_readlist = preg_replace('/href="(.*).shtm"/','href="'.$pt_site_url.$pt_file_show.'?cid='.$cid.'&bid='.$bid.'&sid=\\1"',$pt_templets_readlist);
}
$pt_templets_bookbid=$bid;
include 'geturl.php';
// 规则结束