|
以下为引用的内容:
<?php /** * File: 生成4位的数字 * Author: heiyeluren * Create: 2005-9-5 22:26 */ 中国.站.长站
/* 配置 */ $start_num = 100; $end_num = 999; $save_file = "./number.txt"; 中.国.站长站
//生成从1000到9999的数字序列 for ($i=$start_num; $i<=$end_num; $i++) { php开源嘛 $nums[] = $i; }
//把上面生成的数字序列写入文件 $fp = fopen($save_file, "w") or die("Open $save_file failed"); fwrite($fp, implode("\r\n", $nums)) or die("Write $save_file failed"); unset($nums); fclose($fp);
echo "Create $save_file succeed!"; Www.Chinaz.com
?>
|