I’m getting the word “Array” without the array values in my $result var.
Why am I not getting all the values in $url in the decoded $result?
The values for each var are shown after the #
$url = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$privateKey&response=$response&remoteip=$remoteip");
echo "url =".$url;
# { "success": true, "challenge_ts": "2024-05-17T18:50:22Z", "hostname": "mysite.com" }
echo "<BR>";
$result = json_decode($url, true);
echo "result =".$result;
# "Array"
if($result->success == "true") {
echo "this never happens";
}
else{
echo "reCaptcha failed, please try again...";
}