title: Splitting value of drop down selection into two variables? (PHP/HTML)
body: <p>So I've got a website with two HTML drop-down lists- one is a list of US states, the other is a list of the cities/towns in the selected state.  As of right now, I have an HTML file for each state, and they all have the options listed as such:</p>
  
  <pre><code>&lt;option value="44.729932, -72.381758"&gt;Albany&lt;/option&gt;
  &lt;option value="44.976728, -73.30257"&gt;Alburg&lt;/option&gt;
  </code></pre>
  
  <p>The values are the coordinates (latitude, longitude) of each town.  When I hit "search", the form data is sent to a PHP script for SimpleGeo (a location database company- amazing, btw)- the purpose of selecting the town is to provide values for $lat and $lon in this part of the PHP script, which is sent to SimpleGeo for every query:</p>
  
  <pre><code>$q = $_GET['q'];
  $lat = 44.729932;
  $lon = -72.381758;
  
  $args = array('q' =&gt; $q, 'num' =&gt; 25, 'category' =&gt; Restaurant, 'radius' =&gt; 25);
  $results = $client-&gt;getPlaces($lat, $lon, $args);
  </code></pre>
  
  <p>The part that can't change is the "getPlaces($lat, $lon, $args);" part because for some reason when I replace $lat and $lon with $coordinates and then replace their values with:</p>
  
  <p><code>$coordinates = $_GET['city']; ('city' is the name and id of my city/town lists)</code></p>
  
  <p>It doesn't see it as a valid query.  Meanwhile, if you replace "$lat, $lon" with numbers as the coordinates, it understands perfectly.</p>
  
  <p>... I just need to split up my  values, either in the HTML files themselves, or in the PHP script by recognizing that ", " means the latitude value has ended and the longitude value has started.  I don't know how it should be done, I just know that $lat and $lon have to equal the values set by my HTML files- one file for every state, about 500 options on average per file...  How do I make it recognize something like "44.729932, -72.381758" as $lat and $lon?!  Or alternatively, how do I make my drop down list pass on the values for lat and lon if I make the options look like this:</p>
  
  <pre><code>&lt;option lat="44.976728" lon="-73.30257"&gt;Alburg&lt;/option&gt;
  </code></pre>
  
  <p>Thanks for reading, sorry it's so long!  It's 2:50AM, my eyes are bleeding! :P  Help is MUCH appreciated...</p>