The echo
command only outputs the raw data in the variable (in your case array). You want to pimp it out a bit for a nice display like this:
$newArray = array_merge($DairyArray, $FruitArray);
echo "<ul>";
foreach ($newArray as $key => $value)
{
echo "<li>" . $value . "</li>";
}
echo "</ul>";
Keep in mind that HTML by default requires explicit instructions on how to display something, and omits line breaks, more than one space at a time and many other things. When we deal with data in variables, for the most part, they are generally the raw data without any formatting. You will always need to make it formatted nicely for your web pages - or get used to horrible text only pages :)