TP5.0 excel 导入导出
引第三方的phpexcel类库放到 ThinkPHP\Library\Vendor\demo下,自己建的文件夹demo 再将Excel.class放到ThinkPHP\Library\Org\class下,自己建的文件夹class 控制器: <?php namespace Admin\Controller; use Think\Controller; class ExcelController extends Controller { public function excelList(){ $this->display(); } // 导入 public function import(){ if(!empty($_FILES['file_stu']['name'])){ $tmp_file = $_FILES['file_stu']['tmp_name']; //临时文件名 $file_types = explode('.',$_FILES['file_stu']['name']); // 拆分文件名 $file_type = $file_types [count ( $file_types ) - 1]; // 文件类型 /*判断是否为excel文件*/ if($file_type == 'xls' || $file_type == 'xlsx'|| $file_type =