使用PHPExcel将HTML文件转换为Excel

Hir*_*tel 0 php phpexcel phpexcelreader

我需要在PHPExcel中将html文件(test.html)转换为excel

myhtml文件text.html它是保存test.php但是包含html

请想一想如何实现这个

Mar*_*ker 7

您只需阅读提供的文档,但是:

$inputFileType = 'HTML';
$inputFileName = './myHtmlFile.html';
$outputFileType = 'Excel2007';
$outputFileName = './myExcelFile.xlsx';

$objPHPExcelReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objPHPExcelReader->load($inputFileName);

$objPHPExcelWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,$outputFileType);
$objPHPExcel = $objPHPExcelWriter->save($outputFileName);
Run Code Online (Sandbox Code Playgroud)