我在PHP下面的代码与卷曲/ PHP提取HTML数据
$ch = curl_init("http://blog.com");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
我试图导入的代码块中<div id="content">
和</div>
之间我想知道提取该代码的最佳方式。
请参阅http://stackoverflow.com/questions/3650125/how-to-parse-html-with-php – deceze 2010-10-05 05:46:04
也http://stackoverflow.com/questions/3577641/best-methods-to-parse-html – 2010-10-05 05:46:44