Jump to content

XPath iteration problem


squariegoes

Recommended Posts

Hi I want to be able to iterate over the children of the book element but don't know how to do it.  The childrens names will change between queries so the child must work dynamically.  Is there any way of cycling through the chlidren of an element using []? Here's what I've got so far -

 

if($xml->book[0]->child[1]->attributes() == true){
echo 'attribute found';
}

Link to comment
https://forums.phpfreaks.com/topic/153242-xpath-iteration-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.