title: Create two dropdown boxes from a multidimensional array in php, one for the key, another one for the item in the key
body: <p>I have a multidimensional php array as following:</p>
  
  <pre><code>$country = array ("India" =&gt; array("Maharashtra","Tamil Nadu","West Bengal"),
                    "USA"=&gt; array ("New York", "California", "Florida"),
                    "Canada"=&gt;array("Ontario", "Alberta", "Manitoba"));   
  </code></pre>
  
  <p>I want to create two drop down boxes. One will have the country name. The other will have the state name, which will get populated when the first box is selected.</p>
  
  <p>I have written the code for the first box:</p>
  
  <pre><code>echo "&lt;select name='name'&gt;\n";
  foreach($country as $key =&gt; $item) {
      echo "\t&lt;option&gt;$key&lt;/option&gt;\n";
  }
  echo "&lt;/select&gt;\n";
  </code></pre>
  
  <p>Can anyone suggest me how to create the next drop down box?</p>