News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stoyan Stefanov's Blog:
Simultaneous HTTP requests in PHP with cURL
February 19, 2008 @ 09:34:00

On his blog today, Stoyan Stefanov has a howto posted on a trick he figured out to get a PHP script to grab data from multiple resources at one time - with cURL.

The basic idea of a Web 2.0-style "mashup" is that you consume data from several services, often from different providers and combine them in interesting ways. This means you often need to do more than one HTTP request to a service or services. [...] Using the curl_multi* family of cURL functions you can make those requests simultaneously. This way your app is as slow as the slowest request, as opposed to the sum of all requests. And that's something.

He includes example code that loops through a given array of resources and executes the fetch, brining the results back into a result array. To illustrate, he also includes two types of examples of fetching content - one for GET and another for POST.

0 comments voice your opinion now!
curl simultaneous http request tutorial get post


blog comments powered by Disqus

Similar Posts

Vidyut Luther's Blog: Adding Subscribers to Campaign Monitor Lists using PHP5 and SOAP

Alison Gianotto: Check User-Submitted URLs for Malware and Phishing in Your Application

CorePHP Blog: A Guide to running Apache 2, PHP 4 & PHP 5 on Windows XP

PHPMaster.com: REST - Can You do More than Spell It? Part 3

PHPRiot.com: Zend Framework 101: Zend_Oauth


Community Events





Don't see your event here?
Let us know!


podcast library interview language release series symfony security list voicesoftheelephpant opinion conference version laravel introduction community artisanfiles tool composer framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework