用php将数据写入xls文件: (/t与/n) $file="files/test.xls"; $f = fopen($file, "w+"); fwrite($f,"A1/tB1/t/nA2/tB2/tC2/t/n/t/tC3"); echo(fwrite ? "File was written":"File write failed"); 用php将数据写入csv文件: (,与/n) $fileName = date('Y-m-d').".csv"; $fp = fopen($fileName,"w+"); fwrite($fp,"A1,B1/nA2,B2/n,B3,C3");