clandmeter Posted April 27, 2007 Share Posted April 27, 2007 Hi, Im using simplexml, i want to fetch a value from an array inside an object. Normaly i would do this to get value2: echo $xml->item1->item3[item4]; But now i have to do: echo $xml->item.1->item3[item4]; But the dot in item.1 will give me an error. What would be the correct line to get value2? SimpleXMLElement Object ( [item.1] => SimpleXMLElement Object ( [@attributes] => Array ( [item2] => value1 ) [item3] => SimpleXMLElement Object ( [@attributes] => Array ( [item4] => value2 [item5] => value3 [item6] => value4 [item7] => value5 [item8] => value6 [item9] => value7 ) ) ) ) Thx, Carlo Link to comment https://forums.phpfreaks.com/topic/48920-simplexml-object-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.