What's wrong with my PHP? I go to sandwiches.php?type=2 and all I see is cheeseavocadospinach, not the XML tags with the values.
<?php
header("Content-type: text/xml");
if ($_GET["type"] == "1")
$sandwiches = array('ham', 'turkey', 'cheese');
if ($_GET["type"] == "2")
$sandwiches = array('cheese', 'avocado', 'spinach');
echo '<?xml version="1.0"?>';
echo '<sandwiches>';
foreach ($sandwiches as $value)
{
echo '<sandwich>';
echo $value;
echo '</sandwich>';
}
echo '</sandwiches>';
?>
Please help.
Thanks