PHP:curl_setopt_array给出通知"数组到字符串转换"

rgi*_*gin 5 php curl

curl_setopt_array( $ch, $curl_opt );

此代码发出通知 Notice: Array to string conversion in ...

$curl_opt包含:

array (size=5)
  42 => boolean true
  19913 => boolean true
  10018 => string 'PHP RestClient/0.1.2' (length=20)
  10005 => 
    array (size=1)
      0 => string 'user:password' (length=13)
  10002 => string 'http://longurl.com/' (length=389)
Run Code Online (Sandbox Code Playgroud)

is_array($curl_opt)返回true,所以我真的不知道是什么导致通知.

我想我只是错过了一些非常简单的东西,但我不能,因为我的生活,想出这个.

这只是一个通知,并没有打破任何东西,但它只是让我烦恼,我不知道是什么导致它.

xda*_*azz 7

$curl_opt应该是一维数组................................

关键10005不是那种情况,它应该是

$curl_opt = array(
  //...
  CURLOPT_USERPWD => '[username]:[password]'
  //...
);
Run Code Online (Sandbox Code Playgroud)