I'm using the simplexml class to parse through some xml. when i use
the standard foreach loop syntax, i get the expected results.
<?php foreach ($xml->item as $artist) {
echo $artist->title "<br />";
}?>
Outputs:
Kinky
Matchbox Twenty
When i use the alternate syntax of:
<?php foreach ($xml->item as $artist):?>
echo "$artist->title <br />";
<?php endforeach; ?>
It Outpusts:
echo "$artist->title
"; echo "$artist->title
";
Am i doing something wrong?