title: Pass Array & Multidimensional Array from Android to PHP
body: <p>I have my Android Java code that have to pass some array and some multidimensional array to the PHP Server. Unfortunately, I don't have the access to the PHP Server.</p>
  
  <p>Here's the PHP Server API :</p>
  
  <pre><code>$result= array(
      "username" =&gt; "admin",
      "password" =&gt; "admin",
      "hobbies" =&gt; array(
                  "1" =&gt; "science"
       ),
      "skills" =&gt; array(
                  "1" =&gt; array(
                          "Boxing" =&gt; "Yes"
                      )
       )
  );
  </code></pre>
  
  <p>Here's my Android Java Code :</p>
  
  <pre><code>final String hobbies[] = {"science"};
  final String skills[][] = {{"Boxing"},{"Yes"}};
  
  @Override
  protected Map&lt;String, String&gt; getParams() {
                  Map&lt;String, String&gt; jParams= new HashMap&lt;String, String&gt;();
  
  JSONArray arrHobbies = new JSONArray();
  JSONArray arrSkills = new JSONArray();
  arrHobbies.put(hobbies[0]);
  arrSkills.put(skills[0][0]);
  
  jParams.put("username", "admin");
  jParams.put("password", "admin");
  jParams.put("hobbies",arrHobbies.toString();
  jParams.put("skills",arrSkills.toString();
  
  return jParams;
  }};
  </code></pre>
  
  <p>Then, I use this code to see how the data've been sent.</p>
  
  <pre><code>Log.d("Response : ", jParams.toString());
  </code></pre>
  
  <p>It shows this on the Android Log : </p>
  
  <pre><code>{password=admin, username=admin, hobbies=["science"], skills=[["275]]}
  </code></pre>
  
  <p><strong>UPDATE</strong>
  Here's the hash values when I debug the code:</p>
  
  <pre><code> 0 = {java.util.HashMap$HashMapEntry@4884} "hobbies" -&gt; "{"1":"1"}"
   1 = {java.util.HashMap$HashMapEntry@4885} "password" -&gt; "admin"
   2 = {java.util.HashMap$HashMapEntry@4886} "username" -&gt; "admin"
   3 = {java.util.HashMap$HashMapEntry@4887} "skills" -&gt; "{"1":{"Boxing":"Yes"}}"
  </code></pre>
  
  <p>I never succeed to communicate with the PHP Server API.
  Please help me where am I missing or wrong.</p>