I am new to PHP and AngularJS. I want to get JSON data.
Chrome shows the data I post
{"sessionName":"1","computer":"2","quality":{"name":"LAN(very fast)"}}
I know that if I want to get sesstionName, it's:
$value = json_decode(file_get_contents('php://input'));
echo $value->sessionName;
How can I get quality value from PHP?
You need to access like this
echo $value->quality->name;
Eventually if you prefer to work with arrays instead of objects, my advice is to do:
$value = json_decode(file_get_contents('php://input'),true);
then you can see the result:
print_r($value['quality']);