Recover JSON data via POST

0

I have an application that sends the lambda via POST and retrieval via JSON, but I am not able to separate the coordinates that arrive in an array.

Here's an example

$datas = file_get_contents('php://input');  
$encoded = json_decode($datas);

$id_usuario_rastreio =  $encoded->{'id_usuario'};
$id_grupo =  $encoded->{'id_grupo'};
$id_token =  $encoded->{'token'};

I need to retrieve the locationList now and separate to insert into the database.

{
        "id_grupo": "20",
        "id_usuario": "21",
        "token": "0123456",
        "locationList":[{"date":"Feb 27, 2018 12:32:08 PM","latitude_rastreio":"-10.5267176","longitude_rastreio":"-10.5702931"},{"date":"Feb 27, 2018 12:33:08 PM","latitude_rastreio":"-10.5267176","longitude_rastreio":"-10.5702931"}]
}

Follow the test being performed at POSTMAN

    
asked by anonymous 27.02.2018 / 16:59

0 answers