Last active
April 21, 2020 17:31
-
-
Save binaryreverse/1fa08126fc904bb286e50c506d9106ae to your computer and use it in GitHub Desktop.
PHP fetch content from URL alternative with curl (instead of file_get_contents)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://xxxxxxxxxx.tld'; | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_HEADER, false); | |
$data = curl_exec($curl); | |
curl_close($curl); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment