SimpleXMLElement Object
(
[deelnemer] => Array
(
[0] => SimpleXMLElement Object
(
[startnummer] => A1
[naam] => Jerry
[adres] => Straat 38
[postcode] => 0000 MC
[woonplaats] => Tilburg
[land] => NED
[geboortedatum] => 27-02-1988
[geslacht] => M
[categorie] => Heren
[onderdeel] => E. 10 Miles - start 15u00
)
[1] => SimpleXMLElement Object
(
[startnummer] => A2
[naam] => Wesley
[adres] => straat 13
[postcode] => 0000 AJ
[woonplaats] => Tilburg
[land] => NED
[geboortedatum] => 20-04-1979
[geslacht] => M
[categorie] => Heren
[onderdeel] => E. 10 Miles - start 15u00
)
)
)
I have this array. I need per 'deelnemer' the individual values. I tried:
echo '<select>';
foreach ($xml as $obj)
{
foreach ($obj['deelnemer'] as $ob)
{
echo '<option value='.$ob['naam'].'>'.$ob['naam'].'</option>';
}
}
echo '</select>';
But i keep getting error messages. The only thing i can substract atm is 'deelnemer'.
I need a PHP code to create a loop (for each) with a dropdown select with the names of the participants.