10.4. Curl

Daniel Stenberg leads the Curl project, which aims to handle interpreting URLs and fetching data from them. PHP uses the Curl library to provide this functionality to your scripts. A typical session involves creating a Curl resource with curl_init, setting options with curl_setopt, and executing the request with curl_exec. Instead of a large set of functions, the Curl extension uses a small set of functions paired with a large set of constants used with curl_setopt.

You can learn more about Curl at its home page: <http://curl.haxx.se/>.

Recently, the Curl project added the so-called multi-interface. PHP includes support for these functions, but keep in mind their relative newness.

void curl_close(resource curl)

Use curl_close to free ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.