[Tableaux] Notice : Array to string conversion (pourquoi?)
Bonjour,
Je ne comprends pas pourquoi j'ai cette erreur, certe le script fonctionne normalement, mais j'aimerais comprendre.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| function send(){
$options = array(
CURLOPT_URL => $this->Url,
CURLOPT_HEADER =>1,
CURLOPT_NOBODY => ($this->method==self::METH_HEAD)?1:0,
// CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => $this->headers
);
// print_r($options);
$ch = curl_init(); // create cURL handle (ch)
if (!$ch) {
die("Couldn't initialize a cURL handle");
}
print_r($options);
$ret = curl_setopt_array($ch,$options); // ligne 59 |
J'obtiens l'erreur suivante :
Notice: Array to string conversion in /home/c/m/a/cmako/www/httprequest.php on line 59
pourtant à la ligne 58 (juste avant) j'affiche le contenu de la variable $options le résultalt est surprenant
Je fais appel à la forction send() plusieures fois.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| Array
(
[10002] => http://www.exist.ru/forms/login.asp?sid=32260?target=top?bt=1?pz=0?rnd=700386544
[42] => 1
[44] => 0
[19913] => 1
[10023] => Array
(
[0] => Accept: */*
[1] => Referer: http://www.exist.ru/
[2] => User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[3] => Host: www.exist.ru
[4] => Connection: Keep-Alive
)
)
Array
(
[10002] => http://www.exist.ru/client.asp
[42] => 1
[44] => 0
[19913] => 1
[10023] => Array
(
[0] => Accept: */*
[1] => Referer: http://www.exist.ru/forms/login.asp?sid=32260?target=top?bt=1?pz=0?rnd=700386544
[2] => Accept-Language: ru
[3] => Content-Type: application/x-www-form-urlencoded
[4] => User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[5] => Host: www.exist.ru
[6] => Connection: Keep-Alive
[Cookie] => Array
(
[existru] => yes
[ASPSESSIONIDCADTRADC] => DACHAGGBPHAAAJKBECBPOOHA
)
)
)
<br />
<b>Notice</b>: Array to string conversion in <b>/home/c/m/a/cmako/www/httprequest.php</b> on line <b>59</b><br />
Array
(
[10002] => http://www.exist.ru/newguid.aspx?url1=/client.asp_ques_
[42] => 1
[44] => 0
[19913] => 1
[10023] => Array
(
[0] => Accept: */*
[1] => Referer: http://www.exist.ru/forms/login.asp?sid=32260?target=top?bt=1?pz=0?rnd=700386544
[2] => Accept-Language: ru
[3] => Content-Type: application/x-www-form-urlencoded
[4] => User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[5] => Host: www.exist.ru
[6] => Connection: Keep-Alive
[Cookie] => Array
(
[existru] => yes
[ASPSESSIONIDCADTRADC] => FACHAGGBNFAJEGJDJFMLDLMB
[uname] => serka
[phash] => %7BAAF0F9E2%2DB40D%2DDBB9%2D0713%2DF974E8C13BDF%7D
)
)
)
Array
(
[10002] => http://www.exist.ru/client.asp?
[42] => 1
[44] => 0
[19913] => 1
[10023] => Array
(
[0] => Accept: */*
[1] => Referer: http://www.exist.ru/forms/login.asp?sid=32260?target=top?bt=1?pz=0?rnd=700386544
[2] => Accept-Language: ru
[3] => Content-Type: application/x-www-form-urlencoded
[4] => User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
[5] => Host: www.exist.ru
[6] => Connection: Keep-Alive
[Cookie] => Array
(
[existru] => yes
[ASPSESSIONIDCADTRADC] => FACHAGGBNFAJEGJDJFMLDLMB
[uname] => serka
[phash] => %7BAAF0F9E2%2DB40D%2DDBB9%2D0713%2DF974E8C13BDF%7D
[ASP.NET_SessionId] => 4jtov1bfdanpsu554wvrvxri
[visitid] => af4abadc-1a7d-49e7-8133-bc2f1e3c2d64
)
)
) |
Pour certaines valeurs ça passe, et pour le cas n°2 => erreur.
Est-ce que quelqu'un aurait une explication ?
8O