使用 PHP Simple HTML DOM 解析器获取注释


Get Comments with PHP Simple HTML DOM Parser

我正在使用PHP Simple HTML DOM解析器。

我想知道是否可以提取 HTML 注释 ( <!-- --> )。

你能吗?

直接从他们的文档中:

// Find all comment (<!--...-->) blocks 
$es = $html->find('comment');

http://simplehtmldom.sourceforge.net/manual.htm