//抓取标签内的值
function get_provider($start, $content, $over) {
$thisitem_1 = explode($start, $content);$thisitem_2 = explode($over, $thisitem_1[1]);
$l_value = $thisitem_2[0];
return $l_value;
}
$content = file_get_contents($url); //$url 是要抓取的页面的链接
$result=get_provider('id="main_price">', $content, '</span>');