WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Returns a new cURL multi handle

curl_multi_init

(PHP 5)

curl_multi_initReturns a new cURL multi handle

Description

resource curl_multi_init ( void )

Allows the processing of multiple cURL handles in parallel.

Parameters

mh

A cURL multi handle returned by curl_multi_init().

Return Values

Returns a cURL on handle on success, FALSE on failure.

Examples

Example #1 curl_multi_init() example

This example will create two cURL handles, add them to a multi handle, and then run them in parallel.

<?php
// create both cURL resources
$ch1 curl_init();
$ch2 curl_init();

// set URL and other appropriate options
curl_setopt($ch1CURLOPT_URL"http://www.example.com/");
curl_setopt($ch1CURLOPT_HEADER0);
curl_setopt($ch2CURLOPT_URL"http://www.php.net/");
curl_setopt($ch2CURLOPT_HEADER0);

//create the multiple cURL handle
$mh curl_multi_init();

//add the two handles
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);

$running=null;
//execute the handles
do {
    
curl_multi_exec($mh,$running);
} while (
$running 0);

//close the handles
curl_multi_remove_handle($mh$ch1);
curl_multi_remove_handle($mh$ch2);
curl_multi_close($mh);

?>

See Also


Tell to friend functionality for Multiple Sites
Categories : PHP, Databases, MySQL, Complete Programs
CheckDateInput - Date Checking / Validation functions - with error reporting, multiple separator support, and y2k fix. Choose either own code or php checkdate function version.
Categories : Date Time, PHP
Upload Multiple Files "multi-uploader" (Easy Code)
Categories : PHP, Filesystem



This class splits the results of the query into multiple pages like what the search engine does.
Categories : PHP Classes, PHP, MySQL, Databases
Multi-table database search for your WAP-enabled device. Uses PHP and MySQL. No WMLscript.
Categories : WAP, WML, PHP, MySQL
filesplit : Split big text files in multiple small ones
Categories : PHP, Log Files, Filesystem, PHP Classes
Multiple Search using PHP and Mysql
Categories : PHP, Databases, General SQL, MySQL
Call by reference and multidimensional arrays.
Categories : Arrays, PHP
Filter - A simple class that lets you use multiple functions to create custom filters.
Categories : PHP, PHP Classes, Strings
mySQL/PHP/search with multientry form and table output with colored rows
Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases
Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip
Categories : Email, Network, PHP, PHP Classes
Campaign Mailer - Allows sending emails to a mailing list with multiple classes of emails handled. Suitable for mailing campaigns.
Categories : PHP, PHP Classes, Email
Another Multiplication of large positive integers
Categories : PHP, Math.
Initialize global variables for every field in a table. This is the generic version. It does not require phplib.
Categories : Global Variables, MySQL, PHP, Variables