How would it be possible to access the value stored within the child of a child element? To access the children, I am currently using:
function extractText($array){
if(count($array) <= 1){
for ($i = 0; $i<count($array); $i++){
$node = $array[$i];
$value = $node->get_content();
}
return $value;
}
}
in conjunction with
$xml = domxml_open_file($filename);
$root = $xml->root();
$id = $root->get_attribute("id");
$t1_array = $root->get_elements_by_tagname("title");
$title = extractText($t1_array);
to get the value of a child… I just can’t figure out the way to access the child of that child. for example:
<parent>[INDENT]<child>[INDENT]<child1> <---
<child2> <--- problem areas
<child3> <---
[/INDENT][/INDENT]
Thanks brothers. :samuelljackson:
(script from http://www.sitepoint.com/article/management-system-php/1/)