XI. CURL, client URL library functions
PHP supports Libcurl (allows you to connect and communicate different servers with different protocols). , Libcurl currently supports HTTP, HTTPS, FTP, Gopher, Telnet, dict, file, and LDAP protocols. Libcurl also supports HTTPS certificate authorization, HTTP POST, HTTP PUT, FTP upload (of course you can also use PHP's FTP extension), HTTP basic form uploads, proxies, cookies, and user authentication.
In order to use the Curl function you need to install the Curl package. PHP requires you to use Curl 7.0.2-beta or later. If the version of Curl is lower than 7.0.2-beta,php will not work.
To use PHP's curl support, you must recompile PHP with the--with-curl[=dir] parameter (dir is the directory that contains the library and header files).
These functions are added in PHP 4.0.2.
Once you have compiled PHP with Curl support, you can use the Curl function. The basic idea is that you use the website Building server script class \phpphp user manual Fancyfunction.curl-init.html>curl_init () function to initialize the curl session, and then you can set all your options through curl_exec () function execution, and finally you can function curl_close () function to end your session. Here is an example of putting a PHP home page back into a file.
Example 1. Retrieving PHP home page using PHP's Curl module Directory list curl_init-initialize a curl session curl_setopt-set an option for the Curl call curl_exec-perform a curl session curl_close-close a Curl session curl_version-return when Previous Curl version
http://www.bkjia.com/PHPjc/532354.html www.bkjia.com true http://www.bkjia.com/PHPjc/532354.html techarticle XI. CURL, client URL library function PHP supports Libcurl (allows you to connect and communicate different servers with different protocols). , Libcurl currently supports HTTP, HTTPS, FTP, Gopher, Telnet, dict, file, and ...