分类目录归档:代码
publicfunctiongetUrlContent($url){//初始化一个curl会话$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);curl_setopt($ch,CURLOPT_REFERER,'http://www.phpxs.com');curl_setopt($ch,CURLOPT_...
继续阅读 >
/***字符截取支持UTF8/GBK*@param$string*@param$length*@PHP新手www.phpxs.com*/functionstr_cut($string,$length,$dot='...'){$strlen=strlen($string);if($strlen<=$length)return$string;$string=str_replace(array('',' ','&','"',''','“','”','—','<','>','·','…'),array('∵','','&','"',"'",'“','”','—',...
继续阅读 >