php excel reader 是一个用来读取 excel 表格文件的 php 类,能够获取excel文件(.xls)中任意单元格的值和格式。
下载php excel reader
下载地址:http://sourceforge.net/projects/phpexcelreader/
使用示例:
表格对应内容:
引入类,创建对象,设置读取文件的目录
<?php error_reporting(e_all ^ e_notice);require_once 'excel_reader2.php';$data = new spreadsheet_excel_reader();//创建对象$data->setoutputencoding('utf-8');//设置编码格式$data->read("example.xls");//读取excel文档
读取完毕后,会将表格有关的信息,全部存到一个大数组中。
<?phperror_reporting(e_all ^ e_notice);require_once 'excel_reader2.php';$data = new spreadsheet_excel_reader();//创建对象$data->setoutputencoding('utf-8');//设置编码格式$data->read("example.xls");//读取excel文档echo "<pre>";print_r($data->sheets);echo "</pre>";
运行结果如下
更多相关知识,请访问 !!
