Last active
August 5, 2022 16:05
-
-
Save andreiglingeanu/6cc73f97ef4789a6e84990b20b0b71c9 to your computer and use it in GitHub Desktop.
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 | |
function download_file($url, $destination) { | |
echo 'downloading ' . $destination . "\n"; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt( $ch, CURLOPT_ENCODING, "UTF-8" ); | |
$data = curl_exec ($ch); | |
$error = curl_error($ch); | |
if (substr($destination, -7) === 'lnr.css') { | |
} | |
curl_close ($ch); | |
$file = fopen($destination, "w+"); | |
fputs($file, $data); | |
fclose($file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment