note 39912 modified in function.simplexml-element-children by danbrown
| From: | danbrown@php.net | Date: | Wed, 16 Sep 2009 15:36:42 +0000 |
| Subject: | note 39912 modified in function.simplexml-element-children by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160642@lists.php.net to get a copy of this message | ||
File:
<category>
<item>text</item>
<bold>text</bold>
<item>text</item>
<item>text</item>
<mark>text</mark>
<bold>text</bold>
</category>
If you want to get also names of the tags, you can use this loop layout:
<?php
foreach($category -> children() as $name => $node){
echo $name.'<br/>';
}
?>
--was--
File:
<category>
<item>text</item>
<bold>text</bold>
<item>text</item>
<item>text</item>
<mark>text</mark>
<bold>text</bold>
</category>
If you want to get also names of the tags, you can use this loop layout:
foreach($category -> children() as $name => $node){
echo $name.'<br/>';
}
http://php.net/manual/en/function.simplexml-element-children.php