How to make php code to show what I'm sending to server?
<p>I'm trying to upload a jsonarray to a server and then get the response text to see what the server does to the object. On the android side, I have this code:</p>

<pre><code>            HttpPost httppost = new HttpPost("http://10.0.0.2/namedate.php");I am 
            HttpClient httpclient = new DefaultHttpClient();
            httppost.getParams().setParameter("jsonarray", json_a.toString());
            HttpResponse response = httpclient.execute(httppost);
            String responseText = EntityUtils.toString(response.getEntity());
            Log.d("ProviderTester", "The response text is "+ responseText);
            Log.i("JSONInfo","JSON object: " + json_a.toString());
</code></pre>

<p>The jsonarray looks like this from the logcat:</p>

<pre><code>04-10 21:29:53.293: I/JSONInfo(466): JSON object: ["[name=Mike, datetime=2012-04-10 21:29]","[name=Roger, datetime=2012-04-10 21:29]"]
</code></pre>

<p>At the moment I am just trying to echo the string and then hopefully later get the table out of the string:</p>

<pre><code>   &lt;?php

    echo $_POST['jsonarray'];

   ?&gt;
</code></pre>

<p>Here are the responses I am getting from the logcat:</p>

<pre><code>04-10 22:22:20.033: D/ProviderTester(499): The response text is 
</code></pre>

<p>How do I fix this so I can see the jsonarray string that I am sending to the server?</p>

<p>EDIT: When I change my Android Code to:</p>

<pre><code>            ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
            nameValuePairs.add(new BasicNameValuePair("json_a", json_a.toString()));

            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
            HttpResponse response = httpclient.execute(httppost);
            String responseText = EntityUtils.toString(response.getEntity());
</code></pre>

<p>Then I get the following response in LogCat using the accepted answer for the php script:</p>

<pre><code>04-10 23:05:39.833: D/ProviderTester(601): The response text is POST = array (
04-10 23:05:39.833: D/ProviderTester(601):   'json_a' =&gt; '[name=Mike, datetime=2012-04-10 21:29]\\",\\"[name=Roger, datetime=2012-03-10 21:29]\\"]\\"]',
04-10 23:05:39.833: D/ProviderTester(601): )
04-10 23:05:39.833: D/ProviderTester(601): GET = array (
04-10 23:05:39.833: D/ProviderTester(601): )
04-10 23:05:39.833: D/ProviderTester(601): request = array (
04-10 23:05:39.833: D/ProviderTester(601):   'Content-Length' =&gt; '174',
04-10 23:05:39.833: D/ProviderTester(601):   'Content-Type' =&gt; 'application/x-www-form-urlencoded',
04-10 23:05:39.833: D/ProviderTester(601):   'Host' =&gt; 'graasdfon.hostei.com',
04-10 23:05:39.833: D/ProviderTester(601):   'Connection' =&gt; 'Keep-Alive',
04-10 23:05:39.833: D/ProviderTester(601):   'User-Agent' =&gt; 'Apache-HttpClient/UNAVAILABLE (java 1.4)',
04-10 23:05:39.833: D/ProviderTester(601):   'Expect' =&gt; '100-Continue',
04-10 23:05:39.833: D/ProviderTester(601): )
04-10 23:05:39.833: D/ProviderTester(601): 
04-10 23:05:39.833: D/ProviderTester(601): &lt;!-- www.000webhost.com Analytics Code --&gt;
</code></pre>

<p>Now I just need to figure out how to process json_a server side. Thanks for the help!</p>
