XML php xpath

0 Cevap php

Bunu nasıl elde edebilirsiniz:

<root>
<gallery name="First">
 <picture active="1" detail="not shown"/>
 <picture active="1" detail="not shown"/>
 <picture active="0" detail="not shown"/>
</gallery>
<gallery name="Second">
 <picture active="0" detail="not shown"/>
 <picture active="1" detail="SHOW THIS ONE"/>
 <picture active="1" detail="AND SHOW THIS ONE" />
</gallery>
</root>

Ben çalışıyorum:

$myArray = $objXML->xpath('gallery[@name="Second"]/picture[@active=1]');

How can I change it to get the desired output? Thanks, Andy

0 Cevap