<?php include 'global.php'; $ids = $_GET['ids']; $sql = "select * from crm_cost_end where id in ( {$ids} )"; $result = $db->findAll($sql); //echo $result[1]['sn']; //创建一个excel对象 $objPHPExcel = new PHPExcel(); // Set properties $objPHPExcel
thinkphp3. 将PHPExcel下载包放在项目\ThinkPHP\Library\Vendor\PHPExcel thinkphp5 将PHPExcel下载包放在项目\vendor\PHPExcel (调整后的PHPExcel在文末有下载链接) 在控制器中 use PHPExcel_IOFactory; use PHPExcel; 在方法中 public function exportData() { vendor("PHPExcel.PHPExcel.PHPExcel");