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);?