How can i read a multidimensional JSON array into a multidimensional PHP array
JSON:
{
'updates': {
'ssid':'tb-hotspot1',
'mac':'00:15:6D:1A:A2:E2',
'clientusage': [
{
'ip':'192.168.182.232',
'used':'500000'
},
{
'ip':'192.168.182.200',
'used':'500000'
}
]
}
}
Sent POST to PHP server with curl in bash:
curl -k -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d $json https://myserver.xx/uam.php
Receive POST from curl into PHP:
<?php
$json = file_get_contents("php://input");
echo "\n";
print_r($json);
echo "\n";
echo "\n";
var_dump(json_decode($json));
echo "\n";
echo "\n";
$obj=json_decode($json);
print $obj->Updates[0]->{'SSID'}; //help needed with this line
?>