How to handle jsonarray string uploaded to php server?
<p>cI'm using this code to upload a jsonarray to a server (maybe there is a better way of doing this):</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>The response I am getting in LogCat is:</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>The php script server side looks like this:</p>

<pre><code>&lt;?php

$out="POST = " . var_export($_POST, true) . "\n";
$out.="GET = " . var_export($_GET, true) . "\n";
$out.="request = " . var_export(getallheaders(), true) . "\n";
print $out;

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

<p>I see that 'json_a' => '[name=Mike, datetime=2012-04-10 21:29]\",\"[name=Roger, datetime=2012-03-10 21:29]\"]\"]' contains the data I want, but How do I take the names and dates out of the object?</p>

<p>EDIT:
The when I print out the JSON object in logcat, this is what it looks like (not response from server):</p>

<pre><code> 4-10 23:33:36.013: I/JSONInfo(601): JSON object: ["[name=mike, datetime=2012-04-10 23:33]","[name=red, datetime=2012-04-10 23:12]"]
</code></pre>

<p>Im not sure if ["[name=mike, datetime=2012-04-10 23:33]","[name=red, datetime=2012-04-10 23:12]"] is a correct json object it's just the array printed into a string</p>
