update : 2015.11.03
php.shukuma.com검색:
|
SimpleXMLElement::children(PHP 5 >= 5.0.1) SimpleXMLElement::children — Finds children of given node 설명This method finds the children of an element. The result follows normal iteration rules.
인수
반환값Returns a SimpleXMLElement element, whether the node has children or not. 변경점
예제
Example #1 Traversing a children() pseudo-array
<?php 위 예제의 출력: The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son Example #2 Using namespaces
<?php int(0) int(2) int(2) int(0) int(1) 주의SimpleXMLElement::children() returns a node object no matter if the current node has children or not. Use count() on the return value to see if there are any children. As of PHP 5.3.0, SimpleXMLElement::count() may be used instead. 참고
|