php tutorial spreadsheet_excel_reader reads excel files
This article mainly talks about using spreadsheet_excel_reader to read excel files. When the data volume of your website is very large or there is a lot of member data, it is necessary to import the data of the day into excel backup. For this reason, we provide an example of reading excel files. .
Download a spreadsheet_excel_reader class from the website.
*/
$reader=new spreadsheet_excel_reader();
$reader->setutfencoder('iconv');
$reader->setoutputencoding('utf-8'); //The document encoding that can be set
$reader->read($filename);//If the output is in tabular form, we will use traversal
foreach ($reader->boundsheets as $k=>$sheet)
{
echo "n$k: $sheet";
}//The data in the table is stored in table variables. Each table is a two-dimensional array. Here's how to print all the data
foreach($reader->sheets as $k=>$data)
{
echo "nn ".$reader->boundsheets[$k]."nn";foreach($data['cells'] as $row)
{
foreach($row as $cell)
{
echo "$cellt";
}
echo "n";
}
}