男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

DOMDocument::loadHTML

(PHP 5, PHP 7, PHP 8)

DOMDocument::loadHTML Load HTML from a string

說(shuō)明

public DOMDocument::loadHTML(string $source, int $options = 0): DOMDocument|bool

The function parses the HTML contained in the string source. Unlike loading XML, HTML does not have to be well-formed to load. This function may also be called statically to load and create a DOMDocument object. The static invocation may be used when no DOMDocument properties need to be set prior to loading.

參數

source

The HTML string.

options

Since Libxml 2.6.0, you may also use the options parameter to specify additional Libxml parameters.

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。 If called statically, returns a DOMDocument 或者在失敗時(shí)返回 false.

錯誤/異常

If an empty string is passed as the source, a warning will be generated. This warning is not generated by libxml and cannot be handled using libxml's error handling functions.

在 PHP 8.0.0 之前可以靜態(tài)調用此方法,但會(huì )發(fā)出 E_DEPRECATED 錯誤。自 PHP 8.0.0 起,靜態(tài)調用此方法會(huì )拋出 Error 異常

盡管非正確格式化的 HTML 仍應該被成功調入,但此函數會(huì )在遇到錯誤標記時(shí)產(chǎn)生 E_WARNING 錯誤。libxml 錯誤處理函數可以用來(lái)處理這類(lèi)錯誤。

范例

示例 #1 Creating a Document

<?php
$doc 
= new DOMDocument();
$doc->loadHTML("<html><body>Test<br></body></html>");
echo 
$doc->saveHTML();
?>

參見(jiàn)

男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站