php生成Exeple表demo

<?php
require "./PHPExcel.php";
$dir=dirname(__FILE__);
$objPHPExcel=new PHPExcel();
$objSheet=$objPHPExcel->getActiveSheet();//获得当前活动的sheet
$objSheet->setTitle("demo");
$array=array(
      array("姓名","分数"),
      array("李四","60"),
      array("张三","90"),
	);
$objSheet->fromArray($array);
$objwriter=PHPExcel_IOFactory::createWriter($objPHPExcel,"Excel2007");
$objwriter->save($dir."/demo.xlsx");

  

posted @ 2017-07-11 17:29  czcColud  阅读(195)  评论(0编辑  收藏  举报