php怎么讲字符串变成csv格式
发布网友
发布时间:2022-04-20 16:09
我来回答
共1个回答
热心网友
时间:2022-04-06 05:15
PHPExcel完全可以满足你的要求,给个简单处理例子,具体的你还是看看PHPExcel的文档:
$filename = "myexcel.xlsx";
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load($filename);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
$objWriter->save(str_replace('.xlsx', '.csv',$filename));