<?php
function xBOF() {echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);}
function xEOF() {echo pack("ss", 0x0A, 0x00);}
function Number($Row, $Col, $Value) {
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
}
function Label($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=result.xls");
header("Content-Transfer-Encoding: binary");
xBOF();
Label(0, 0, "Cell A1");
Label(0, 1, "Cell B1");
Number(1, 0, 10); // Cell A2
xEOF();
?>