前提:要下载PHPEXCEL库文件
情形一:对于将数据写入EXCEL表中的用法
header("content-type:text/html;charset=utf-8");
require "PHPEXCEL/Classes/PHPExcel.php";
require "PHPEXCEL/Classes/PHPExcel/IOFactory.php";
require "PHPEXCEL/Classes/PHPExcel/Reader/Excel5.php";
require "PHPEXCEL/Classes/PHPExcel/Reader/Excel2007.php";
require "PHPEXCEL/Classes/PHPExcel/Reader/Excel2003XML.php";
require "PHPEXCEL/Classes/PHPExcel/Writer/Excel2007.php";
require "PHPEXCEL/Classes/PHPExcel/Writer/Excel5.php";
$phpexcel = new PHPExcel();
###### 其中包含了 ‘读’与‘写’类########
$phpexcel->getActiveSheet()->getStyle(‘A1‘)->getAlignment()->setWrapText(true); //该语句用于换行,但必须与下面配套使用
$phpexcel->getActiveSheet() ->setCellValue(‘A1‘,"Tilel \n ID"); //请注意这里的 ‘\n‘ ,这与上面的呼应使用的
$phpexcel->getActiveSheet()->setTitle($code_title); //设置比标题