private function recaptcha_qsencode($data) { $req = ""; foreach ($data as $key => $value) { $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; } // Cut the last '&' $req = substr($req, 0, strlen($req) - 1); return $req; }