logiacer logiacer - 9 months ago 50
JSON Question

cURL PHP Getting value of JSON




$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $response);

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POST, false);

curl_setopt($ch, CURLOPT_TIMEOUT, 3);

$content = curl_exec ($ch);

curl_close ($ch);

return $content;

now I have json_decoded it, I can't get value of "status".

echo $foo->value1; works fine.

echo $foo->status; isn't right. How would I get that value?

Answer Source

The value of status should be access like below: