使用phpexcelreader这个类文件来导入excel具体步骤:
先下载文件,然后引入phpexcelreader:下载地址:http://www.waaqi.com/wp-content/uploads/2012/03/phpExcelReader.zip
require_once 'reader.php';
//实例化
$data = new Spreadsheet_Excel_Reader();
//设置编码
$data->setOutputEncoding('utf-8');
//读取文件$save_path替换为xls文件路径
$data->read($save_path);
for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
//以下注释的for循环打印excel表数据
for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) {
//cells为excel的函数为了获取一些信息 $i为行 $j为列
echo $data->sheets[0]['cells'][$i][1];
echo $data->sheets[0]['cells'][$i][2];
echo $data->sheets[0]['cells'][$i][3];
}
}
可以输出excel文件的值了
目前好像不支持excel2003以上的