1

I have an api service which returns xml of the below kind:

<KidsAges xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <a:int>3</a:int>
    <a:int>4</a:int>
</KidsAges>

Now here the element denotes that there were 2 kids in the room. How can I read this while using simplexml with PHP. I just want to count the number of elements .

Thanks.

Anoop
  • 173
  • 1
  • 1
  • 14
  • 2
    Possible duplicate of [Parse XML with Namespace using SimpleXML](http://stackoverflow.com/questions/595946/parse-xml-with-namespace-using-simplexml) – Calimero Dec 01 '15 at 16:33
  • Thanks. With your reference solved it like this - count($room_value->KidsAges->xpath('a:int')) – Anoop Dec 01 '15 at 16:40

0 Answers0