curl_share_close

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

curl_share_closeClose a cURL share handle

Beschreibung

curl_share_close(CurlShareHandle $share_handle): void

Hinweis:

Diese Funktion hat keine Auswirkung. Vor PHP 8.0.0 wurde sie verwendet, um die Ressource zu schließen.

Closes a cURL share handle and frees all resources.

Parameter-Liste

share_handle

Ein gemeinsames cURL-Handle, das von curl_share_init() zurückgegeben wird.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Changelog

Version Beschreibung
8.0.0 share_handle erwartet nun eine CurlShareHandle-Instanz; vorher wurde eine Ressource erwartet.

Beispiele

Beispiel #1 curl_share_setopt() example

This example will create a cURL share handle, add two cURL handles to it, and then run them with cookie data sharing.

<?php
// Create cURL share handle and set it to share cookie data
$sh curl_share_init();
curl_share_setopt($shCURLSHOPT_SHARECURL_LOCK_DATA_COOKIE);

// Initialize the first cURL handle and assign the share handle to it
$ch1 curl_init("http://example.com/");
curl_setopt($ch1CURLOPT_SHARE$sh);

// Execute the first cURL handle
curl_exec($ch1);

// Initialize the second cURL handle and assign the share handle to it
$ch2 curl_init("http://php.net/");
curl_setopt($ch2CURLOPT_SHARE$sh);

// Execute the second cURL handle
//  all cookies from $ch1 handle are shared with $ch2 handle
curl_exec($ch2);

// Close the cURL share handle
curl_share_close($sh);

// Close the cURL handles
curl_close($ch1);
curl_close($ch2);
?>

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

BitLife: A Fun and Realistic Life Simulation Adventure

BitLife is one of the most popular life simulation games available on mobile devices today. In this game, players can create a virtual character a ...

Geschrieben von bellabrown am 02.06.2026 08:43:01
Forum: PHP Developer Forum
The Complete Guide to Buying and Renting CS2 Skins--UUSkins

As the Counter-Strike 2 (CS2) skin market continues to heat up, more and more players are looking for a platform that combines a massive inventory ...

Geschrieben von UUSKINSJune am 02.06.2026 08:41:50
Forum: Off-Topic Diskussionen
MMOexp Diablo4 to enhance orb duration

Thanks for sharing this build discussion. It's always interesting to see different strategies and optimizations that can improve gameplay performa ...

Geschrieben von golfhit am 02.06.2026 08:32:53
Forum: PHP Developer Forum
Wordle Unlimited: The Ultimate Word Puzzle Challenge for Everyone

Introduction to Wordle Unlimited Wordle Unlimited has become one of the most popular online word puzzle games in recent years. Inspired by the c ...

Geschrieben von GertrudViksillas am 02.06.2026 05:47:11
Forum: PHP Developer Forum