Hi every body
Can someone help me with this problem
I try to print an array with the text between my tags.
This is the xml file called mo_originated.xml:
<?xml version="1.0" standalone="yes" ?>
<message_delivery>
<authentication><user_name>client</user_name>
<password>secret</password></authentication>
<mobile_originated id='b8e059:fd94881a39:-797' redelivered='false' test='false'>
<mo_message id='12345678'>
<text>Test text</text>
<keyword>test</keyword>
<stop>false</stop>
<mobile_number>441234567890</mobile_number>
<network_name>o2</network_name>
<inbound_number>12345</inbound_number>
</mo_message>
</mobile_originated>
</message_delivery>
And this is a script php I use to parse my xml file
<?php
include("xmlparser.php");
$p =& new xmlParser();
$p->parse('mo_originated.xml');
function parse_depth(&$array){
if (!is_array($array)){
return $array;
}
else{
foreach ($array as $key=>$value)
$array[$key]=parse_depth($value);
}
return $array;
}
$data=parse_depth($p->output);
print_r($data);
?>
The problem is with this function parse_depth