PHP
$ch = curl_init();
$options = [
CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify',
CURLOPT_POST => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_POSTFIELDS => [
'secret' => 'key',
'response' => $_POST['g-recaptcha-response'],
],
];
curl_setopt_array($ch,$options);
$out = curl_exec($ch) ;
$a = json_decode($out);
var_dump($a);
当我填写recaptcha时,它在此文件中仅返回null。这是api或下载recaptcha包的最佳选择。