SimpleXML probleme avec un node
Hello,
j ai un probleme de recuperation de données avec xml
j ai un fichier avec un node screenshot et dedans des sous node screeshot num=0, num=1 etc..
le probleme est que je recuperer rien a part les attributs
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
$data =
<<<EOT
<screenshots><screenshot num='0'><![CDATA[http://url.com/img1.jpg]]></screenshot><screenshot num='1'><![CDATA[http:http://url.com/img2.jpg]]></screenshot><screenshot num='2'><![CDATA[http://url.com/img3.jpg]]></screenshot><screenshot num='3'><![CDATA[http://url.com/img4.jpg]]></screenshot></screenshots>
EOT
;
$xml = simplexml_load_string($data);
echo '<pre>';
print_r($xml);
echo '</pre>'; |
resultat du print_r :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
SimpleXMLElement Object
(
[screenshot] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[num] => 0
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[num] => 1
)
)
[2] => SimpleXMLElement Object
(
[@attributes] => Array
(
[num] => 2
)
)
[3] => SimpleXMLElement Object
(
[@attributes] => Array
(
[num] => 3
)
)
)
) |
C est moi qui m y prends mal ou c est un probleme de simplexml ?