CODE function xlsBOF() {
echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}
function xlsEOF() {
echo pack("ss", 0x0A, 0x00);
return;
}
function xlsWriteNumber($Row, $Col, $Value) {
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
return;
}
function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
echo $Value;
return;
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=php2xls.xls "); // à¹à¸¥à¹‰à¸§à¸™à¸µà¹ˆà¸à¹‡à¸Šà¸·à¹ˆà¸ ไฟล์
header("Content-Transfer-Encoding: binary ");
// XLS Data Cell
xlsBOF();
xlsWriteLabel(1,0,"PHP Group VN");
xlsWriteLabel(2,0,"Website : ");
xlsWriteLabel(2,1,"http://phpbasic.com");
xlsWriteLabel(3,0,"TITLE : ");
xlsWriteLabel(3,1,"Dien dan thao luan PHP");
xlsWriteLabel(4,0,"Copyright @ ");
xlsWriteLabel(4,1,"PHP Group VN");
xlsWriteLabel(6,0,"NO");
xlsWriteLabel(7,0,"1");
xlsWriteLabel(6,1,"ID");
xlsWriteLabel(7,1,"2104");
xlsWriteLabel(6,2,"Gender");
xlsWriteLabel(7,2,"Male");
xlsWriteLabel(6,3,"Name");
xlsWriteLabel(7,3,"TG");
xlsEOF();
?>
|