Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:curl_setopt_数组发出通知”;“数组到字符串的转换”;_Php_Curl - Fatal编程技术网

PHP:curl_setopt_数组发出通知”;“数组到字符串的转换”;

PHP:curl_setopt_数组发出通知”;“数组到字符串的转换”;,php,curl,Php,Curl,curl\u setopt\u数组($ch,$curl\u opt) 这段代码给出了一个通知。Notice:Array-to-string-conversion in… 这就是$curl\u opt包含的内容: array (size=5) 42 => boolean true 19913 => boolean true 10018 => string 'PHP RestClient/0.1.2' (length=20) 10005 => arr

curl\u setopt\u数组($ch,$curl\u opt)

这段代码给出了一个通知。
Notice:Array-to-string-conversion in…

这就是
$curl\u 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)
is\u array($curl\u opt)
返回
true
,所以我真的不知道是什么引起了这个通知

我想我只是错过了一些非常简单的东西,但我就是不能,为了我的生命,弄明白这一点


这只是一个通知,并没有破坏任何东西,但它只是烦扰我,我不知道是什么原因造成的

$curl\u opt
应该是一个一维数组

10005
不是这种情况,它应该是

$curl_opt = array(
  //...
  CURLOPT_USERPWD => '[username]:[password]'
  //...
);

我不知道这件事。非常感谢。这解决了我的问题。我会尽快接受你的回答。你能发一些代码吗?