首先将数组拆分成以逗号(注意需要英文)分割的字符串
* 2. 然后加上每行的换行符号,这里建议直接使用PHP的预定义
* 常量PHP_EOL
* 3....最后写入文件
*/
// 打开文件资源,不存在则创建
$fp = fopen('data_test.csv','a');
// 处理头部标题
$header = implode(',', $csv_header...PHP_EOL;
// 处理内容
$content = '';
$total = 100000;//总条数
$num1 = 0.8*$total;//不重复条数
$num2 = $total-$num1...;//重复条数
for($i=0;$i<$num1;$i++){
$data = make_password();
$content .= $data ....'U', 'V', 'W', 'X', 'Y','Z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
// 在 $chars 中随机取