Apathy is the suck. Login and vote now.
By skoop
via ibuildings.nl
Published: Mar 31 2008 / 21:14
Most PHP developers have heard of the CURL extension for PHP or even used it. However it is mostly used in a basic form: to retrieve content from other websites or (RESTful) webservices. Ofcourse PHP itself offers several functions (like fopen or fsockopen) for getting this content, but they are all very basic. It is easy to run into limitations, for example you might want to define the request method or set another user agent (if you're building a webspider). This is where the curl extension kicks in. It is a separate library that has to be compiled with PHP in order to use it. The Curl extension has many functions and options which offer the developer more flexibility than the standard PHP functions.
Let me show you a simple example of using Curl to get the content of another website.
Comments
lhoguin replied ago:
Misleading title, but I didn't know about that one.
Voters For This Link (6)
Voters Against This Link (0)