This article will introduce the Thief program through Curl.
<!--use Curl to do the thief program--
<?php//How to request, map and other third-party APIs? This time you need to use the--curl. Curl Chinese is called a URL-based library of functions. Its main function is to use related functions to simulate protocol requests. For example://1. The analog table sends data//2 one-way address. Impersonate a form without a verification code to complete the user login//3. Upload a file to a remote server//4. Request some features provided by the remote server//curl support DICT,FILE,FTP,FTP S,gopher,http,https,imap,imaps,idap,idaps,//pop3,pop3s,rtmp,rtsp,smtp,smtps,teinet, and TFTP protocols. Curl also supports HTTPS authentication, HTTP POST, HTT and Pput, FTP uploads (this//can also be done via PHP ftp extension), HTTP forms-based uploads, proxies, cookies, and Username + password Authentication.?> <!-- Curl uses the methods and steps--<?php//1. Initializes the Curl resource//2. Parameter sets the protocol address of the request//3. Sets whether to return the request result//4. Set send data (no send data is not set)//5. Other parameter Information settings ( According to actual work needs)//6. Execution or execution gets the returned result//7. Close the curl resource $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, "https://www.php.cn"); curl_setopt ($ch, Curlopt_returntransfer, 1); curl_setopt ($ch, Curlopt_header, 0); $output = curl_exec ($ch); Curl_close ($ch); Print_r ($output);?> <!--Curl Custom Get Method Crawl Web page--<?php $content = Get (' https://www.xmtnews.com/events '); Preg_match ('/<section class= ' ov ' > (. *?) <p class= "HR-10 "><\/p>/mis", $content, $match); $area = $match [1]; Preg_match_all ('/
This article describes the thief process through curl.