title: How to convert android JSON data into PHP array
body: <p>I have an JSON data in format of</p>
  
  <pre>
  [{"product_id":"33","amount":"1"},{"product_id":"34","amount":"3"},{"product_id":"10","amount":"1"},{"username":"test"}]
  </pre>
  
  <p>now I want to fetch those data in my PHP web system. I am sending those data into PHP server from an android application. I am using below code to send it to web server.</p>
  
  <pre><code>public JSONObject sendAndGetJSONfromURL(String url,List&amp;lt;NameValuePair&amp;gt; params){
          InputStream is = null;
          String result = "";
          JSONObject jArray = null;
  
          //http post
          try{
                  HttpClient httpclient = new DefaultHttpClient();
                  HttpPost httppost = new HttpPost(url);
                  httppost.setHeader("Content-type", "application/json");
                  httppost.setHeader("Accept", "application/json");
                  httppost.setEntity(new UrlEncodedFormEntity(params));
                  HttpResponse response = httpclient.execute(httppost);
                  HttpEntity entity = response.getEntity();
                  is = entity.getContent();
  .....
  </code></pre>
  
  <p>Before send it I print the <pre>jArray.toString()</pre> and got the output as</p>
  
  <pre><code>[{"product_id":"33","amount":"1"},{"product_id":"34","amount":"3"},{"product_id":"10","amount":"1"},{"username":"test"}]
  </code></pre>
  
  <p>I want to know that how can I fetch those values from PHP system. Can anyone please help me?</p>
  
  <p>Output of the params variable value looks like below before sending via HTTPRequest</p>
  
  <pre><code>[cartdata=[{"product_id":"33","amount":"1"},{"product_id":"34","amount":"3"},{"product_id":"10","amount":"1"},{"username":"UWUDAMITH"}]]
  </code></pre>