PHP Simple HTML DOM Parser -


MIT
跨平台
PHP

软件简介

这是一个 PHP5 的 HTML 文档解析器,示例代码:

// Create DOM from URL or file
$html = file_get_html ('http://www.google.com/’);

// Find all images
foreach($html-> find (‘img’) as $element)
echo $element-> src . ‘
‘;

// Find all links
foreach($html-> find (‘a’) as $element)
echo $element-> href . ‘
‘;