PHP Download a file

Download a file

<?
$url = "http://127.0.0.1/file.jpg";
$cc = file_get_contents($url);
$open = fopen("test.jpg", 'a');
fwrite($open,$cc);
fclose($open);
?>