读书人

html联动的兑现

发布时间: 2012-11-06 14:07:00 作者: rapoo

html联动的实现

html内容:

?

正则匹配HTML内容

//header('Content-Type:text/html;chaset=utf-8;');$str = file_get_contents("http://www.myip.cn/ename.cn");//$str = "<td class='td_bold'>IP所在地:</td><td id='res_iplocation_0'>广东省中山市 电信<br><img width=18 border=0";preg_match("/IP所在地:<\/td><td id=\'res_iplocation_0\'>([".chr(0xa1)."-".chr(0xff)."\s]+)<br>/si", $str, $matches);//preg_match("/res_iplocation_0[\'\"\s]*>(.*?)<br>/si", $str, $matches);print_r($matches);
?

读书人网 >CSS

热点推荐