Copy code The code is as follows:
// Initialization
$curl = curl_init();
// To access URL
curl_setopt($curl, CURLOPT_URL, 'http://asen.me/');
// Set source
curl_setopt($curl, CURLOPT_REFERER, 'http://google.com/ ');
// Do not enter content directly
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Save the drop result in $result
$result = curl_exec($curl);
// Close
curl_close($curl);
Note, when using this method, make sure your PHP environment supports and has the CURL module enabled.
http://www.bkjia.com/PHPjc/323396.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323396.htmlTechArticleCopy 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_RE...