準備:
1.將 php.exe 的路徑加入 windows 的環境變量
2.編寫文件:
D:\fileGeter.php
<?php
$filelist = Array(
"http://**********/a.txt",
"http://**********/b.txt",
);
$saveas="D:\\" ;
$endl = ".txt"
function getfile(){
foreach( $filelist as $k => $file )
file_put_contents( $saveas . $k . $endl , file_get_contents( $file ) ) ;
}
getfile();
?>
3.執行cmd命令
at 11:20 /every:1,2,3,4,5,6,7 "php D:\fileGeter.php"
linux 更方便
直接把此文件包含進 妳要寫的程序裏就OK了,
fileGeter.php:
<?php
...
...
$saveas = "./";
...
..
>index.php:
<?php
require_once("fileGeter.php");
//and so on .....
.....
....
....
>