PHP and cURL : Part 1 – Introduction

cURL is essentially a command line tool for getting or sending files using URL syntax. The cURL extension to PHP has been created to allow developers to use web resources from within a PHP script. The original expansions of cURL are “Client for URLs” or “Client URL Request Library”. It supports a range of common Internet protocols, currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, LDAPS, DICT, TELNET and FILE.

The basic process to use Curl involves four steps:

  • Initialise cURL
  • Set options
  • Execute query
  • Close cURL

Most developers find the Set options step confusing. Curl is extremely configurable and there are a multitude of options that can be set. We will learn this in the next part.

Share Article/Example:
  • DotNetKicks
  • DZone
  • StumbleUpon
  • Print
  • Add to favorites
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • LinkedIn
  • Posterous
  • Slashdot

 

 
eXTReMe Tracker