我有一个示例代码:
<?php
$adr = 'http://www.proxynova.com/proxy-server-list/country-gb/';
$c = file_get_contents($adr);
if ($c){
$regexp = '#<td>(.*?):(\d{1,4})</td>#';
$matches = array();
preg_match_all($regexp,$c,$matches);
print_r($matches);
if (count($matches) > 0){
foreach($matches[0] as $k => $m){
$port = intval($matches[2][$k]);
$ip = trim($matches[1][$k]);
}
}
}
我$regex = '#<td>(.*?):(\d{1,4})</td>#';
用来获取数据包括IP和端口,但结果为空,如何解决它!