亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

I used Dreamweaver to write the code, but PHPExcel can't get the correct xls file exported in the web page
phpcn_u13074
phpcn_u13074 2017-08-03 16:16:40
0
2
1856

This is my code

<?php

$dir=dirname(_FILE_);

require $dir."/PHPExcel/PHPExcel.php" ;

$objPHPExcel=new PHPExcel();

$objSheet=$objPHPExcel->getActiveSheet();

$objSheet->setTitle("demo") ;

//$objSheet->setCellValue("A1","Coco")->setCellValue("b1","Egg");

$array=array(

array("Name","Age"),

array("Dake","58")

);

$objSheet ->fromArray($array);

$objWriter=PHPExcel_IOFactory::createWriter($objPHPExcel,"Excel5");

$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);

header('Content-Type: application/vnd.ms-excel');

header('Content-Disposition: attachment;filename="ch3.xls"') ;

header('Cache-Control: max-age=0');

$objWriter->save("php://output");

?> But the generated xls file does exactly this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

< title>Untitled Document</title>

</head>

<body>????;??? ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????


??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Oh?? '??0?@Hh? ?

???Untitled?SpreadsheetUnknown?CreatorUnknown?Creator@???@ ?@???@ ???? ?

??B?=?%r8X"1??Calibri???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ???????? ??? ?????8???????????????????????????????3f??????ff???f??????????????????????????????????????3f?3?????????fff????3f3?f333?3?3f33?333?demo??g????Y

Tt^??'Y?S

?????

??* ??????&ffffff??'ffffff??(??)???"dXX333333??333333??U} $??? } $? ?

?

?

M@>?@d??dgg?????

?????.?? ,??0?HP X`hp

x ?? 

Worksheet Feuilles?de?calculRoot?Entry????????? ?F???@ ????@ ??SummaryInformation(?????? ?F?Workbook????????????? ?F?DocumentSummaryInformation8???????????? ?F??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

</body>

</html>無法顯示.jpg

phpcn_u13074
phpcn_u13074

reply all(1)
Ty80

$dir=dirname(_FILE_); The first line is wrong. The magic constant is __FILE__, not _FILE_.

QQ截圖20170805085356.png

  • reply How to achieve reading the data in the database?
    木槿 author 2017-11-01 08:52:02
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template