


PHP Spreadsheet_Excel_Reader imports excel Chinese display garbled_PHP tutorial
Jul 13, 2016 am 10:57 AMThis article will introduce to you the solution to the problem that PHP Spreadsheet_Excel_Reader imports Excel into Chinese and displays garbled characters and cannot read files in .xlsx format. Students who have encountered such problems can refer to it.
Spreadsheet_Excel_Reader is a commonly used php class for importing excel files.
Under normal circumstances, the code to import excel using this class is as follows
The code is as follows
|
Copy code
|
||||
<?php //Introduce system public files.
require_once ('../global.php'); $data = new Spreadsheet_Excel_Reader(); //Set the output type (can be "GBK" or "UTF-8"), pay attention to the encoding conversion when inserting into the database$data->setOutputEncoding('CP936'); //Read excel file address |
$data->read('20110630_ctms.xls');
//Print out the number of rows in each sheet, $k starts from zero
2. Encoding problem. Chinese characters appear garbled.
Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
