SimpleExcel PHP - Excel文檔處理庫

jopen 12年前發布 | 37K 次閱讀 PHP Office文檔處理

這是一個簡單而強大的PHP類庫,支持包括生成和解析Microsoft Excel XML/CSV 格式的文件。

它可以一次處理一行中所有單元格或單個單元格。對于列也具有同樣的方法。使用示例:

<?php

use SimpleExcel\SimpleExcel;

require_once('../your/project/lib/SimpleExcel/SimpleExcel.php'); // load the main class file

$excel = new SimpleExcel('xml');                    // instantiate new object (will automatically construct the parser)

$excel->parser->loadFile('example.xml');            // load an XML file from server to be parsed

$foo = $excel->parser->getField();                  // get complete array of the table
$bar = $excel->parser->getRow(3);                   // get specific array from the specified row (3rd row)
$baz = $excel->parser->getColumn(4);                // get specific array from the specified column (4th row)
$qux = $excel->parser->getCell(2,1);                // get specific data from the specified cell (2nd row in 1st column)

print_r($foo);                                      // echo the array

?>

項目主頁:http://www.baiduhome.net/lib/view/home/1343177889084

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!