php读取excel内容 字段格式变了

WBOY
Release: 2016-06-23 13:53:38
Original
1198 people have browsed it

excel是常规字段:
 201407170002
 201407170001
 201407160039
 201407160038
 201407160037

可PHP读取后变成:
MA 02148
MA 02148
MA 02148
MA 02148
MA 02148

怎么解决?用的是PHPExcel来读取


回复讨论(解决方案)

不可能,两者没有相似之处
你可能弄错了列

可以把供测试的 xls 文件放到云盘上

查看excel原始表格 数据类型

不可能,两者没有相似之处
你可能弄错了列

可以把供测试的 xls 文件放到云盘上




列没错的,修改后测试如下:

excel是常规字段:
 发货人固话
 201407170002
 201407170001
 201407160039


可PHP读取后变成:
发货人固话
MA 02148
MA 02148
MA 02148

已经放到服务器:http://www1.jysmr.com/Example100.xls

请各位帮看下,十分感激

找到原因了,但不知怎么解决

当前面字段有这个的内容: Drive #303, Malden, MA 02148

它就不能读取的面的那行

它就不能读取后面的那行

这个?

你指的是那列?

include 'Plugin/PHPExcel/Classes/PHPExcel/IOFactory.php';$filename= 'Example100.xls';$excel = PHPExcel_IOFactory::load($filename);$sheet = $excel->getActiveSheet();for($i=1; $i<5; $i++) {  echo $sheet->getCell("I$i")->getValue(), PHP_EOL;//  echo $sheet->getCell("I$i")->getFormattedValue(), PHP_EOL;}
Copy after login
发货人固话 201407170002 201407170001 201407160039
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!