可以通过PHP来产生EXCEL档. teaman翻译 ---------------------------- Excel Functions ---------------------------- 将下面的代码存为excel.php ,然后在页面中包括进来
然后调用 1. Call xlsBOF() 2. 将一些内容写入到xlswritenunber() 或者 xlswritelabel()中. 3.然后调用 Call xlsEOF()
也可以用 fwrite 函数直接写到服务器上,而不是用echo 仅仅在浏览器上显示。
<?php // ----- begin of function library ----- // Excel begin of file header function xlsBOF() { echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); return; } // Excel end of file footer function xlsEOF() { echo pack("ss", 0x0A, 0x00); return; } // Function to write a Number (double) into Row, Col function xlsWriteNumber($Row, $Col, $Value) { echo pack("sssss", 0x203, 14, $Row, $Col, 0x0); echo pack("d", $Value); return; } // Function to write a label (text) into Row, Col function xlsWriteLabel($Row, $Col, $Value ) { $L = strlen($Value); echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L); echo $Value; return; } // -----[1] [2] 下一页 更多精彩:学习网->http://www.haohao888.com.cn 网络编程->http://www.51wlpc.com 电脑设备->http://www.xpmaster.cn
|