PHP4 User manual: Function-curl_php Tutorial

Source: Internet
Author: User
Tags gopher
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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.