: This article mainly introduces the CURL application in PHP and the Google implementation based on modifications. if you are interested in the PHP Tutorial, refer to it. What can I do?
The most basic purpose of the curl Library in PHP is to simply and effectively * capture webpage content *, and then process and analyze the captured webpage data through a program, finally, get the data you want. Of course, this is the most basic usage, and there are other complex and interesting uses, depending on the setting of the number of curl_setopt () rows.
How to use
First, you must install the curl extension in PHP, that is, the following is displayed in phpinfo! [Write Image description here] (http://img.blog.csdn.net/20150309200749680) then you can start to use, the specific steps: 1. use curl_init () to initialize a curl session 2. use curl_setopt () to set all required options 3. use curl_exec () to execute the Session 4. use curl_close () to close the session after execution.
Ps:Curl_setopt ()It is the key to curl usage. many complex usage is based on this
A simple example
The preceding example is from the official documentation.
Use CURL to capture host scripts of GOOGLE