note 111180 rejected from simplexmlelement.children by aharvey

From: Date: Wed, 23 Jan 2013 09:36:25 +0000
Subject: note 111180 rejected from simplexmlelement.children by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-193357@lists.php.net to get a copy of this message
Note Submitter: ghanbari dot daniel at gmail dot com ---- --- From manual page: http://www.php.net/simplexmlelement.children --- hi, what do this method? this method have a output like paren object my xml: <?xml version="1.0" encoding="UTF-8"?> <modules> <module state='active'> <name>menu</name> <position>right</position> <params> <param name='id'>10</param> <param name='alaki'>forTest</param> </params> </module> <module state='deactive'> <name>amar</name> <position>35</position> </module> </modules> ------------------ $modules = simplexml_load_file($configFile); output "var_dump($modules);" is: --------------- object(SimpleXMLElement)#12 (1) { ["module"]=> array(2) { [0]=> object(SimpleXMLElement)#8 (4) { ["@attributes"]=> array(1) { ["state"]=> string(6) "active" } ["name"]=> string(4) "menu" ["position"]=> string(5) "right" ["params"]=> object(SimpleXMLElement)#13 (1) { ["param"]=> array(2) { [0]=> string(2) "10" [1]=> string(7) "forTest" } } } [1]=> object(SimpleXMLElement)#11 (3) { ["@attributes"]=> array(1) { ["state"]=> string(8) "deactive" } ["name"]=> string(4) "amar" ["position"]=> string(2) "35" } } } --------------- output "var_dump($modules->children());" is: --------------- object(SimpleXMLElement)#14 (1) { ["module"]=> array(2) { [0]=> object(SimpleXMLElement)#16 (4) { ["@attributes"]=> array(1) { ["state"]=> string(6) "active" } ["name"]=> string(4) "menu" ["position"]=> string(5) "right" ["params"]=> object(SimpleXMLElement)#18 (1) { ["param"]=> array(2) { [0]=> string(2) "10" [1]=> string(7) "forTest" } } } [1]=> object(SimpleXMLElement)#17 (3) { ["@attributes"]=> array(1) { ["state"]=> string(8) "deactive" } ["name"]=> string(4) "amar" ["position"]=> string(2) "35" } } } --------------- they have like BEHAVIOR in foreach

« previous php.notes (#193357) next »