title: PHP not displaying correctly in HTML
body: <p>I'm trying to create a drop down box that is populated by an array. When I view my code the browser just displays pieces of the php code.</p>
  
  <p>Here is what the browser displays:</p>
  
  <pre><code>'; foreach ($array as $value) { $html .= '
  $value
  '; } $html .= ''; return $html; } ?&gt; 
  </code></pre>
  
  <p>Here is my code:  </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;test&lt;/title&gt;
  &lt;?php
  
  $cities = array( 'San Francisco', 'San Diego', 'Los Angeles');
  
  function createDropDown($name, $array) {
  
    $html = '&lt;select name=$name&gt;';
  
    foreach ($array as $value) {
      $html .= '&lt;option value="$value"&gt;$value&lt;/option&gt;';
    }
    $html .= '&lt;/select&gt;';
    return $html;
  }
  ?&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
  
  &lt;?php
  createDropDown("cities", $cities);
  ?&gt;
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>