多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
PHP Simple HTML DOM Parser 中文手册: http://microphp.us/plugins/public/microphp_res/simple_html_dom/manual.htm ``` <?php include('./simple_html_dom.php'); header("Content-Type:text/html;charset=UTF-8"); $url = 'http://www.phpernote.com/'; $html = file_get_html($url); $logoImg = $html->find('img#logoImg', 0); // 获取 logo 图片地址 echo $logoImg->src; //输出:/images/logo.gif // 获取 logo 的链接地址 echo $logoImg->parent()->href; //输出:http://www.phpernote.com/ // 输出最新文章列表 $left = $html->find('#left_sidebar ul', 0); echo $left->children(2)->find('ul', 0)->innertext; echo '<hr/>'; $url = 'http://www.phpernote.com/'; $html = file_get_html($url); foreach($html->find('.right_box_left ul', 2)->find('li a') as $element) { echo $element->plaintext . '<br/>'; echo $num->plaintex; // substr($num->plaintex,-4); // substr('4018909419000248', 0, -6); } echo '<hr/>'; foreach($html->find('.right_box_left ul', 2)->find('li a') as $element) { echo $element->href . '<br/>'; echo $num->plaintex; } ```