php 远程下载图片|视频
<?php
/**
* 下载文件图片|视频
*
* @param string $file 远程文件路径
* @param string $save 本地路径
*/
function down($file, $save)
{
$in = fopen($file, "rb");
$out = fopen($save, "wb");
while ($chunk = fread($in, 8192)) {
fwrite($out, $chunk, 8192);
}
fclose($in);
fclose($out);
}
?>
Comment here is closed