Dreamweaver cms eksport data borang tersuai ke cemerlang
phpcn_u2562
phpcn_u2562 2017-08-04 08:40:09
0
1
1150

Sila beritahu saya cara mengeksport data borang tersuai daripada cms DreamWeaver ke Excel

phpcn_u2562
phpcn_u2562

membalas semua(1)
Ty80
<?php
$dir=dirname(__FILE__);
require $dir."/PHPExcel.php";
$objPHPExcel=new PHPExcel();
$objSheet=$objPHPExcel->getActiveSheet();
$objSheet->setTitle("demo");
//$objSheet->setCellValue("A1","可可")->setCellValue("b1","蛋蛋");
$array=array(
array("姓名","年龄"),
array("大可","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");


Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan