array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.curl-reset.php', 1 => 'curl_reset', ), 'up' => array ( 0 => 'ref.curl.php', 1 => 'cURL Funktionen', ), 'prev' => array ( 0 => 'function.curl-pause.php', 1 => 'curl_pause', ), 'next' => array ( 0 => 'function.curl-setopt-array.php', 1 => 'curl_setopt_array', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'de', 'path' => 'reference/curl/functions/curl-reset.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
curl_reset — Setzt alle Optionen eines libcurl-Session-Handles zurück
Diese Funktion setzt alle Optionen, die für das angegebene cURL-Handle gesetzt wurden, auf die Standardwerte zurück.
handle
Ein von curl_init() zurückgegebenes cURL-Handle.
Es wird kein Wert zurückgegeben.
Version | Beschreibung |
---|---|
8.0.0 |
handle erwartet nun eine
CurlHandle-Instanz; vorher wurde eine
Ressource erwartet.
|
Beispiel #1 curl_reset()-Beispiel
<?php
// Erstellt ein cURL-Handle
$ch = curl_init();
// Setzt die CURLOPT_USERAGENT-Option
curl_setopt($ch, CURLOPT_USERAGENT, "Mein Test-User-Agent");
// Setzt alle Optionen zurück
curl_reset($ch);
// Führt den HTTP-Request aus
curl_setopt($ch, CURLOPT_URL, 'http://example.com/');
curl_exec($ch); // the previously set user-agent will be not sent, it has been reset by curl_reset
// Schließt den Handle
curl_close($ch);
?>
Hinweis:
curl_reset() setzt außerdem die URL zurück, die in der curl_init()-Funktion gesetzt wurde.