php - return multiple nodes with xpath -


how return more 1 node on page? here code using, returns 1st node found.

$dom = new domdocument; $dom->loadhtmlfile($url);  $xpath  = new domxpath($dom); $users= $xpath->query('//b[@class="xc_user"]');  echo $users->item(0)->nodevalue; 

$users domnodelist, can iterate over:

foreach($users $node) {     echo $node->nodevalue; } 

Comments

Popular posts from this blog

haskell - Using filter on an item in a list? -

c# - When does PreApplicationStartMethod actually get triggered to run? -

tomcat6 - Exception when stopping container for a with Spring + Quartz + Tomcat web application -