我想使用DOM Document获取整个body标签内容.
我使用以下代码:
$dom = new domDocument;
/*** load the html into the object ***/
$dom->loadHTML($html);
/*** the table by its tag name ***/
$tables = $dom->getElementsByTagName('body')->item(0)->nodeValue;
Run Code Online (Sandbox Code Playgroud)
这给了我TExt.我想要全身内容.
php ×1