foreach($files as $val){ print($val."\r\n"); file_put_contents($val,file_get_contents("http://storage.us.to/addar/".$val)); if(is_file($val)){ print("[$val] Successfully Updated.\r\n"); }else{ print("Failed to update files.\r\n"); } }