O'Reilly logo

PHP in a Nutshell by Paul Hudson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Curl

The cURL extension to PHP is designed to allow you to use a variety of web resources from within your PHP script. The name cURL (called Curl from now on, for ease of reading) stands either for “Client for URLs” or “Client URL Request Library,” but the function is the same: it lets you use several Internet protocols using one uniform interface, most notably FTP, FTPS, HTTP, HTTPS, and LDAP.

The basic premise to using Curl is that there are four steps: initialize Curl, set your options, execute your query, and close Curl. Steps 1, 3, and 4 are easy, with the majority of the work taking place in step 2. Curl is highly configurable, and there are dozens of options you can set to make it do all sorts of weird and wonderful things. While this is undoubtedly a great advantage, it does make the learning curve a little high.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required