Home > Backend Development > PHP Tutorial > michael jackson you are not al Use CURL in PHP to forge sources to grab pages or files

michael jackson you are not al Use CURL in PHP to forge sources to grab pages or files

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:45:02
Original
1315 people have browsed it

Copy the code The code is as follows:


// Initialization
$curl = curl_init();
// The URL to be visited
curl_setopt($curl, CURLOPT_URL, 'http://asen.me/') ;
// Set the source
curl_setopt($curl, CURLOPT_REFERER, 'http://google.com/');
// Do not enter the content directly
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Drop the result Save in $result
$result = curl_exec($curl);
// Close
curl_close($curl);


Note, when using this method, make sure your PHP environment supports and enables the CURL module.

The above introduces michael jackson you are not al's use of CURL forged origins to crawl pages or files in PHP, including the content of michael jackson you are not al. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template