我不能使用php的curl选项CURLOPT_PASSWDFUNCTION,得到通知:
PHP Notice: Use of undefined constant CURLOPT_PASSWDFUNCTION - assumed 'CURLOPT_PASSWDFUNCTION'
Run Code Online (Sandbox Code Playgroud)
样品:
function get_passwd($ch, $string, $length){
return 'password';
}
curl_setopt($ch, CURLOPT_PASSWDFUNCTION, 'get_passwd');
Run Code Online (Sandbox Code Playgroud)
PHP信息:
PHP 5.4.40(cli)(建于2015年4月29日02:17:51)版权所有(c)1997-2014 PHP Group Zend Engine v2.4.0,版权所有(c)1998-2014 Zend Technologies
我做错了什么?
UPD:curl正在工作,当我执行我的代码时,我收到消息"请输入密码",我输入密码并使用ecnryption和证书通过ssl获取数据.我想避免手动输入密码.