查看PHP生成的HTML源选择菜单

I'm using PHP to generate the select menu for an HTML web form as follows:

$foods = array( 
    '1' => 'fruit',
    '2' => 'pizza',
    '3' => 'bread',
    '4' => 'nuts',
);

Here's the code for the HTML select input:

<select id="food" name="food">
    <option value="*">- No Selection - </option>
    <?php 
        $output = "";
        $selected = false;

        foreach($foods as $food => $value) {
            $food = htmlspecialchars($food);
            $output .= "<option value=\"$food\"";
            if ($food == $pcSymptomSearch) {
                $selected = true;
                $output .= " selected";
            }
            $output .= ">$value</option>";
        }
        echo $output;
    ?>
</select>

I've noticed when viewing the source in Safari/Mac OS X that the select input generated by PHP appears on one line like this, which makes reading/debugging a bit tricky:

<option value="1">fruit</option><option value="2">pizza</option><option value="3">bread</option><option value="4">nuts</option>                     </select>

Is there a way to make each option appear on one line like this:

    <option value="1">fruit</option>
    <option value="2">pizza</option>
    <option value="3">bread</option>
    <option value="4">nuts</option>                     
</select>

All you have to do is when you are building your string for output add a (newline character) every place that the newline would be appropriate.

 $output .= ">$value</option>
";

Replace:

$output .= ">$value</option>";

with

$output .= ">$value</option>
";