In PHP 5.2.6, the header option requires an array and not a string if PHP is built with --with-curlwrappers
Patrick Allaert
http://patrickallaert.blogspot.com/
Options de contexte CURL
Options de contexte CURL — Liste des options de contexte CURL
Description
Les options de contexte CURL sont disponibles lorsque l'extension CURL a été compilée en utilisant l'option de configuration --with-curlwrappers.
Exemples
Exemple #1 Récupère une page et envoie des données avec la méthode POST
<?php
$postdata = http_build_query(
array(
'var1' => 'du contenu',
'var2' => 'doh'
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://example.com/submit.php', false, $context);
?>
Options de contexte CURL
patrick dot allaert at gmail dot com
05-Sep-2008 11:48
05-Sep-2008 11:48
