Hudzilla.org - the homepage of Paul Hudson
Contents > Networks Wish List | Report Bug | About Me ]

15.10     Curl

This is NOT the latest copy of this book; click here for the latest version.

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 (we will be calling it 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 web protocols using one uniform interface, most notably FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, and LDAP.

The basic premise to using Curl is that there are four steps: initialise 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 very, very 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. This book is not solely about Curl, so we shall not be covering it in its entirety, however I have picked a selection of uses for Curl that should give you enough of a head start to be able to learn the rest yourself.





<< 15.9.1 Other helpful FTP functions: ftp_put(), ftp_systype(), ftp_rename(), ftp_mkdir(), and ftp_rmdir()   15.10.1 Installing Curl >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
Be the first to add a comment to this chapter!



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is three plus zero?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow