摘要: 获取所有链接内容和地址function getAllURL($code){preg_match_all('/"\' ]+)["|\']?\s*[^>]*>([^>]+)/i',$code,$arr);return array('name'=>$arr[2],'url'=>$arr[1]);}获取所有的图片地址function getImgSrc($code){$reg = "/]*src=\"(http:\/\/(.+)\/(.+)\.(jpg|gif|bmp| 阅读全文
posted @ 2014-01-20 12:29 chinall 阅读(301) 评论(0) 推荐(0) 编辑
摘要: php删除字符串中的所有空格 其实是对trim函数的扩展 trim只能删除字符串两边的空格function trimall($str)//删除空格{ $qian=array(" "," ","\t","\n","\r"); $hou=array("","","","",""); return str_replace($qian,$hou,$str); } 阅读全文
posted @ 2014-01-20 12:28 chinall 阅读(351) 评论(0) 推荐(0) 编辑
摘要: /* QQ:17509102 http://www.xingyunba.com /*function keywords($url){ $spier=array('baidu.'=>'百度','google.'=>'谷歌','soso.'=>'搜搜','sogou.'=>'搜狗','www.so.com'=>'360'); $q=array('百度'=>'/wd=([^& 阅读全文
posted @ 2014-01-20 12:26 chinall 阅读(307) 评论(0) 推荐(0) 编辑