I have the following PHP code:
<?php
$string = "
<root>
<row>
<kod>1.1</kod>
<kategorie>Title1</kategorie>
</row>
<row>
<kod>1.2</kod>
<kategorie>Title2</kategorie>
</row>
</root>";
$xml = simplexml_load_string($string);
//print_r($xml);
foreach($xml->children() as $item){
echo $item->kod;
echo "<BR />";
}
?>
I saw no output, only two <BR />
. I don't understand why. Is the fullstop in 1.1 the problem? Or is kod some keyword in PHP? It showed me only onetimes the output, but not again, but I changed nothing. If I write echo $item->kategorie; everything is OK. Thank you.