title: How to retrieve JSON Array Data in Android site via JSONencoded string pushed by PHP Script?
body: <p>I have written a PHP script below try to Post the JSON encoded string to Android device as below:</p>
  
  <pre><code>&lt;?php
   // Create HostConnection
   $host = $_SERVER['HTTP_HOST'];  
   if ($host)
   {
      $data = array('HTTP_HOST' =&gt; $host);    
   }
   else
   {
      $data = array('HTTP_HOST' =&gt; "Not Available");
   }
  
   // Create Connection
   $link = mysql_connect('127.0.0.1:3306', 'root', 'xxxxxx');
   if ( $link != false )
   {
      //echo "mysql_connect success !";
      // Set Use UTF-8 String
      if (mysql_set_charset('utf8', $link)  &amp;&amp; $db_selected = mysql_select_db("gw"))
      {
         // echo "mysql_set_charset() success&lt;br /&gt;";       
         array_push($data, "SQL_DB", "gw");           
      } 
   }
   else
   {
     array_push($data, "SQL_DB", "Not Available");
   }       
  
   print_r(urldecode(json_encode($data)));
  ?&gt;
  </code></pre>
  
  <p>Before post to Android device, I run this PHP script on the localhost(127.0.0.1) and got the result shown on the screen as:</p>
  
  <pre><code>{"HTTP_HOST":"127.0.0.1","0":"SQL_DB","1":"gw"}
  </code></pre>
  
  <p>Why there are 3 sets of data ? what I really want is 2 sets of data shown and prepare send to Android device on nest step.  Where I was wrong ? If yes, what's the correct procedures to retrieve the encoded JSON array string on Android side ?</p>