apache+php系统换了几个,就是报错?何解?
照着老师的代码运行,居然是错的?!
代码
$dir=dirname(__file__);
require $dir."/phpexcel/phpexcel.php";
$objPHPExcel=new PHPExcel();
$objsheet=$objPhPExcel->getActiveSheet();//此行为第5行
$objsheet->setTitle("demo");
$objSheet->setcellValue("A1","姓名")->setCellValue("B1","分数");
$objWriter=PHPExcel_IOFactory::createWriter($objPHPExcel,"Excel5");
$objWriter->save("demo.xls");
错误提示:Notice: Undefined variable: objPhPExcel in D:\WWW\demo.php on line 5