PHP高级curl采集完整实例仅供参考(完整版)作者王明昌发布时间2018-10-06最后更新2018-10-07(.*?)/si'; preg_match_all($block_rule,$str,$fenlei); if(!empty($fenlei)){ // print_r($fenlei[1]); $count = count($fenlei[1]); for($i=0;$i<$count;$i++){ $cat_rule='/(.*?)<\/a>/si'; preg_match_all($cat_rule,$fenlei[1][$i],$cats); if(!empty($cats)){ // echo "复制"; // print_r($cats[1]); // print_r($cats[2]); if(!empty($cats[1][1])){ $url_r = $cats[1][1]; $name_r = $cats[2][1]; $content_str = get_str($url_r); $content_rule ='/(.*?)rel="nofollow" target="_blank"><\/a>.*?<\/div>.*?<\/div>/si'; // echo $content_str; @preg_match_all($content_rule,$content_str,$cont); if(!empty($cont)){ echo $name_r.$cont[1][0].' '; }else{ // echo $name_r.'--'.$url_r.' '; echo $name_r.' '; } } } } } // echo $str; //curl获取网页内容 function get_str($url){ $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); $str = curl_exec($ch); curl_close($ch); return $str; }
2018-08-22支付宝支付接口错误说明错误查询 https://docs.open.alipay.com/58/103599/ 今天我遇到的一个错误,经过询问小二,网关错误,错误如下 ILLEGAL_ACCESS_SWITCH_SYSTE
2019-12-10阿里巴巴开源镜像提供的 packagist 镜像服务全局配置(推荐) 所有项目都会使用该镜像地址: composer config -g repo.packagist composer https://mirrors.aliyun.com/compos
2018-08-26实例 | 支付宝支付(使用md5加密)参数的获取 pid|key获取: 商户中心---账户管理---查看pid|key https://openhome.alipay.com/platform/keyManage.htm?keyType=
2018-10-31实例 | tp5使用七牛云上传图片和文件/删除文件thinkphp5中使用七牛云 下载 https://github.com/qiniu/php-sdk vendor文件下 新建文件 application/extra/qiniu.php retur
2018-05-28ajax-post传值的写法var data = {type:type,is_ok:is_ok,id:id}; $("#train").on("click",function(){ var id = $("#id_res").v
2018-05-27Ajax异步搜索内容,并显示使用ajax异步搜索内容,如果符合内容,则一行行的显示,每次查询时清空上次的记录 $("#search").on("click",function(){ var key = $("#keywords"