/*by www.phpddt.com*/Header ("Content-type:text/html;charset=utf-8"); Require_once'excel_reader2.php'; //Creating Objects$data =NewSpreadsheet_excel_reader ();//set the text output encoding$data->setoutputencoding ('UTF-8'); //reading Excel Files$data->read ("Example.xls"); //Sheets[0] To read the first sheet//sheets[0][' NumRows '] is the maximum number of rows//sheets[0][' Numcols ') is the maximum number of columns//sheets[0][' cells ' is the actual content of the table as a two-dimensional array of [number of rows] [columns]//$data->sheets[0][' NumRows ') is the number of lines in Excel for($i =1; $i <= $data->sheets[0]['NumRows']; $i + +) { //$data->sheets[0][' Numcols ') is the number of Excel columns for($j =1; $j <= $data->sheets[0]['Numcols']; $j + +) { //Show each cell contentsEcho $data->sheets[0]['cells'[$i] [$j].' '; } Echo'<br>'; }
Php-excel-reader Notes for use