Sending ArrayList from Android to PHP script using JSON

前端 未结 3 1314
轮回少年
轮回少年 2020-12-10 00:06

What is the Scenario

I want to send multiple ArrayList (usally 5) from android to the server and want to insert it into mysql database.

3条回答
  •  不知归路
    2020-12-10 00:43

    Very simple. you should parse your JSON in php and get array of objects that you have sent. Here is solution

     $JSON_Received = $_POST["json"];
     $obj = json_decode($JSON_Received, true);
      $array_1st_name = $obj[0];
      $array_2nd_name = $obj[1];
    

    and so on you will get all array of object.

提交回复
热议问题