Heim  >  Artikel  >  Backend-Entwicklung  >  php读取excel内容 字段格式变了

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

WBOY
WBOYOriginal
2016-06-23 13:53:381200Durchsuche

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;}
发货人固话 201407170002 201407170001 201407160039

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:关于ecshop的smarty问题Nächster Artikel:PHP redis操作类 个人总结