This method finds the children of the element of which it is a member. The result
follows normal iteration rules.
Note: SimpleXML has made a rule of adding
iterative properties to most methods. They cannot be viewed using var_dump()
or anything else which can examine objects.
foreach ($xml->children() as $second_gen) { echo ' The person begot a ' . $second_gen['role'];
foreach ($second_gen->children() as $third_gen) { echo ' who begot a ' . $third_gen['role'] . ';';
foreach ($third_gen->children() as $fourth_gen) { echo ' and that ' . $third_gen['role'] . ' begot a ' . $fourth_gen['role']; } } } ?>
This script will output:
The person begot a son who begot a daughter; The person
begot a daughter who begot a son; and that son begot a son
Php simplexml element children Function syntax tag
simplexml element children php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php simplexml element children syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.