PHP 获取html中某个div中内容的方法是什么?

已邀请:

zkbhj - 凯冰科技站长

赞同来自:

$ch = curl_init();  
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $data );
$return = curl_exec( $ch );
curl_close( $ch );

$regex4="/<div class=\"tideTable\".*?>.*?<\/div>/ism";
if(preg_match_all($regex4, $return, $matches)){
print_r($matches);
}else{
echo '0';
}

要回复问题请先登录注册