Created
May 30, 2011 16:48
-
-
Save sorich87/999145 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 file_it($url) { | |
$c = curl_init(); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($c, CURLOPT_URL, $url); | |
$contents = curl_exec($c); | |
curl_close($c); | |
$file = basename($url); | |
if ($contents) file_put_contents($file, $contents); | |
echo "$file ok<br />"; | |
} | |
file_it('http://wordpress.org/latest.tar.gz'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment