摘要: 简单的几个函数介绍file_get _contents();preg_match();首先获取你要采集的网页 并采集内容$str = file_get_contents("www.baidu.com");// 获取地址url$regex = "/(<div class=\"content\" id=\"article\".*?><.*?>.*?<\/.*?><\/div>)/ism";//正则表达式preg_match($regex,$str,$t);//正则匹配返回 阅读全文
posted @ 2013-06-12 09:29 靳贵书 阅读(356) 评论(0) 推荐(0) 编辑