人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁(yè)面

php生成EXCEL的東東

php生成EXCEL的東東

更新時(shí)間:2022-09-13 文章作者:未知 信息來(lái)源:網(wǎng)絡(luò) 閱讀次數(shù):

可以通過(guò)PHP來(lái)產(chǎn)生EXCEL檔.  teaman翻譯
----------------------------
Excel Functions
----------------------------
將下面的代碼存為excel.php ,然后在頁(yè)面中包括進(jìn)來(lái)

然后調(diào)用
1. Call xlsBOF()  
2. 將一些內(nèi)容寫入到xlswritenunber() 或者 xlswritelabel()中.
3.然后調(diào)用 Call xlsEOF()

也可以用 fwrite 函數(shù)直接寫到服務(wù)器上,而不是用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;
}
// ----- end of function library -----
?>

//  
// To display the contents directly in a MIME compatible browser  
// add the following lines on TOP of your PHP file:

<?php
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");     
header ("Pragma: no-cache");     
header ('Content-type: application/x-msexcel');
header ("Content-Disposition: attachment; filename=EmplList.xls" );  
header ("Content-Description: PHP/INTERBASE Generated Data" );
//
// the next lines demonstrate the generation of the Excel stream
//
xlsBOF();   // begin Excel stream
xlsWriteLabel(0,0,"This is a label");  // write a label in A1, use for dates too
xlsWriteNumber(0,1,9999);  // write a number B1
xlsEOF(); // close the stream
?>

溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 新化县| 浦县| 克东县| 沛县| 昂仁县| 平遥县| 上蔡县| 会同县| 长乐市| 东至县| 河北省| 高台县| 平乐县| 遂川县| 吉木乃县| 黔江区| 射阳县| 新龙县| 朝阳县| 张掖市| 靖安县| 灵宝市| 习水县| 库尔勒市| 泗洪县| 崇义县| 志丹县| 阜城县| 金溪县| 卓资县| 天镇县| 阜平县| 涿鹿县| 岗巴县| 义马市| 棋牌| 朝阳县| 丘北县| 茌平县| 当涂县| 崇文区|