Concept:
CURL (client URL Library Functions) is a command lines tool for transfering the data with URL syntax (which uses the URL syntax to transfer the commands of the database), that is, the client to the service Tool to request resources.
Usage scenarios:
① Web page resources (e.g., web crawler authoring)
②webservice Data Interface resources (such as dynamic access to interface data, such as weather, number attribution, etc.)
③FTP file Resources in the server (download files from FTP server)
④ Other resources (all resources on the network can be accessed and downloaded using CURL)
Using CURL in PHP
① confirm that PHP supports CURL
Under Windows:
In the cmd command line (need to add the PHP installation path to the environment variable) input
Php-i
Or
Php-m
or in browser input localhost view phpinfo
Find CURL. For example, in Phpinfo:
Under Linux, use the command:
See if PHP supports CURL.
When PHP does not support curl, you will need to install the Curl extension .
② adding CURL Support
Reference: http://www.cnblogs.com/airy/archive/2011/07/08/2100390.html
Using CURL in PHP
① initializing CURL
Curl_init ()
② send request to server ③ accept server data
Curl_exec ()
④ Turn off CURL
Curl_close ()
CURL Learning Notes and summarizing (1) concepts