PHP生成CSV文件 //提前创建对应的文件路径 $filePath = '/tmp/乐杨俊/'; if (!file_exists($filePath)) { mkdir($filePath, 0777, true); } //创建CSV文件 $fileName = $filePath . iconv('UTF-8', 'GB2312//IGNORE', "leyangjun.csv"; $fp= fopen($fileName, 'w'); chmod($fileName, 0777); //写入头部内容 fputcsv($fp,