Home >php教程 >PHP源码 >看糗百简单PHP版

看糗百简单PHP版

PHP中文网
PHP中文网Original
2016-05-25 17:02:071212browse

糗百PHP版  

<?php
require &#39;phpQuery/phpQuery.php&#39;;
phpQuery::newDocumentFile(&#39;http://hxyl.net/&#39;);
$art = pq(&#39;#content .entry&#39;);
foreach($art as $k=>$v){
    print &#39;标题:&#39;.pq($v)->find(&#39;h2&#39;)->html().&#39;<br>&#39;;
    print &#39;内容:&#39;.pq($v)->find(&#39;p:eq(0)&#39;)->html().&#39;<hr>&#39;;
}


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn