日期:2014-05-16 浏览次数:20391 次
//获取td栏的代码
$regex = "/<td Height=\"30\">([\s\S]*?)<\/td>/";
$str = file_get_contents('http://www.zh818.com/get/quanguo-jg/');
$matches = array();
preg_match_all($regex, $str, $matches);
echo "\n";
//获得网址
$href ='/<a .*?href="(.*?)".*?>/is';
$href_single = array();
if(preg_match($href, $matches[0][1], $href_single))
//根据获得的网址获取表格信息
$regex = '/<table border="1" width="100%">.*([\d\.]+?).*<\/table>/sU';
$str = file_get_contents($href_single[1]);
$matches = array();
if(preg_match($regex, $str, $matches))
$result = $this->transmitText($object, $matches);