title: Automatic Dropdown based on Country with Geoplugin
body: <pre><code>  &lt;?PHP
      function visitor_country()
      {
          $client  = @$_SERVER['HTTP_CLIENT_IP'];
          $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
          $remote  = $_SERVER['REMOTE_ADDR'];
          $result  = "Unknown";
          if(filter_var($client, FILTER_VALIDATE_IP))
          {
              $ip = $client;
          }
          elseif(filter_var($forward, FILTER_VALIDATE_IP))
          {
              $ip = $forward;
          }
          else
          {
              $ip = $remote;
          }
       $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=196.1.1.0"));
          if($ip_data &amp;&amp; $ip_data-&gt;geoplugin_countryName != null)
          {
              $result = $ip_data-&gt;geoplugin_countryName;
          }
  
          return $result;
  
      }
  
  &lt;select name="country" id="country"&gt;
  &lt;option value=""&gt;--&lt;/option&gt;
  &lt;option  data-dialcode="91" value="India"&gt;India&lt;/option&gt;
  &lt;option  data-dialcode="81" value="Japan"&gt;Japan&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I want to automatic selected for option based on country with geoplugin..
  for example $result="India"; i need default select option in india</p>