复制代码 代码如下:
include 'phpQuery/phpQuery.php'; 
phpQuery::newDocumentFile('http://www.vevb.com'); 
echo pq(".blkTop h1:eq(0)")->html();
复制代码 代码如下:
include 'phpQuery/phpQuery.php'; 
phpQuery::newDocumentFile('http://www.vevb.com'); 
$artlist = pq(".blog_li"); 
foreach($artlist as $li){ 
   echo pq($li)->find('h2')->html().""; 
}
复制代码 代码如下:
<?xml version="1.0" encoding="utf-8"?> 
<root> 
  <contact> 
     <name>张三</name> 
     <age>22</age> 
  </contact> 
  <contact> 
     <name>王五</name> 
     <age>18</age> 
  </contact> 
</root>
复制代码 代码如下:
include 'phpQuery/phpQuery.php'; 
phpQuery::newDocumentFile('test.xml'); 
echo pq('contact > age:eq(0)');
结果输出:22
新闻热点
疑难解答