I receive a array
of size (1) sent by POST
of a JSON
:
Array
(
[{
"promotion": {
"name": "PRUEBAS_|_NO_BORRAR",
"subdomain": "pruebas"
},
"playNumber": 9,
"playData": {
"code": "3MBY9P",
"email": "cruiz@po_es",
"NOMBRE": "Carlos_ruizs"
},
"prize": "NO_PREMIO",
"device": "Macintosh",
"platform": "OS_X",
"browser": "Firefox",
"ip": "62_117_146_31",
"playDateTime": "2017-03-21_12:52:36"
}] =>
)
I've tried to go through it in every way. I have also made a decode
of array
parameter received, but still have the same format:
$array = json_decode(json_encode($json), true, 512);
To go through it I tried:
foreach ($array as $indice => $valor) {
echo $indice;
var_dump($valor);
}
But without result. Any ideas on how to solve it?
I also tried:
$array=json_decode($json, true);
but Apache gives me this answer
: Got error 'PHP message: PHP Warning: json_decode () expects parameter 1 to be string, given array
And I've tried like that (Apache does not complain, but I do not get anything)
$array= json_decode(json_encode($json),true));