I m using google site verification recaptcha API for my website.
$json = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret."&response=".$response."&remoteip=".$ip);
when I print echo $json;
its showing proper response
{ "success": true, "challenge_ts": "2018-08-23T12:43:42Z", "hostname": "staging.my.com" }
but when i tried
$data = json_decode($json,true);
echo $data->success;
its showing nothing
Could anybody tell me what i am missing??