标题 日期 人气
file_get_contents发送头部模拟cookie登入 11-13 114
file_get_contents发送头部模拟cookie登入...
标签(Tag): file_get_contents cookie登入
php采集链接地址 11-07 234
php采集链接地址 ?php //来源:http://www.phpzy.com /* $fangwenurl上一页访问地址http://www.phpzy.com/index.html包含http:// $url采集链接地址bbb.html不一定包含http:// */ function buyuming( $fangwenurl , $url ){ $fangw...
标签(Tag):
php取域名部分 11-07 70
php取域名部分 ?php //来源:http://www.phpzy.com function phpzyyuming( $url ){ $urlyuming = parse_url ( $url ); $urlyuming = http:// . strtolower ( $urlyuming [ 'host' ]);//取域名部分 return $urlyuming ; } ?...
标签(Tag):
php正则匹配内容 11-07 97
php正则匹配内容 ?php //来源:http://www.phpzy.com /* $preg正则匹配内容 $con采集url内容 $num0是带链接a1是链接地址 */ function phpzycontent( $preg , $con , $num =1){ preg_match( $preg , $con , $arr ); return $arr [ $...
标签(Tag):
php获取Headers Location 11-07 87
php获取Headers Location ?php //来源:http://www.phpzy.com function Headers_Location( $url , $a =1) { if ( $a == 1 ){ $arr =get_headers( $url , $a ); $url2 = $arr [ 'Location' ]; if ( $url2 ) return $url2 ; } else { $urlyuming = parse_url...
标签(Tag):
php解决gbk与utf8转码问题 11-07 168
php解决gbk与utf8转码问题 ?php //来源:http://www.phpzy.com function gbk_uft( $str ) { if (is_utf8( $str )==false){ $str =iconv( gb2312 , UTF-8 , $str ); } return $str ; } ?...
标签(Tag):
php判断字符是否utf8 11-07 177
php判断字符是否utf8 ?php //来源:http://www.phpzy.com function is_utf8( $word ) { if (preg_match( /^([ . chr (228). - . chr (233). ]{1}[ . chr (128). - . chr (191). ]{1}[ . chr (128). - . chr (191). ]{1}){1}/ , $word )==true||preg_ma...
标签(Tag):
php获取文件里的html链接 11-07 173
php获取文件里的html链接 ? //来源:http://www.phpzy.com function geturl( $re , $ufile , $rep1 , $rep2 ){ preg_match_all( $re , $ufile , $out ,PREG_PATTERN_ORDER); $result = count ( $out [1]); $i =0; while ( $i $result ) { $outs [ $i...
标签(Tag):
php写入缓存文件 11-07 143
php写入缓存文件 ? //来源:http://www.phpzy.com function phpzywritetocache( $cachedir , $cachename , $cachedata = '' ){ $cachedir = './' . $cachedir . '/' ; $cachefile = $cachedir . $cachename . '.php' ; if (! is_dir ( $cachedir )){ @...
标签(Tag):
php彻底清除所有HTML代码 11-07 189
php彻底清除所有HTML代码 ? //来源:http://www.phpzy.com function phpzyhtml($ content ) { $search = array ( 'script[^]*?.*?/script'si , //去掉javascript '[\/\!]*?[^]*?'si , //去掉HTML标记 '([\r\n])[\s]+' , //去掉空白字符...
标签(Tag):