PHPExcel防止大数以科学计数法显示
source link: http://abcdxyzk.github.io/blog/2021/02/05/lang-phpexcel/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
kk Blog —— 通用基础
date [-d @int|str] [+%s|"+%F %T"]
Use the up and down arrows to select a result. Press enter to go to the selected search result. Touch device users can use touch and swipe gestures.
PHPExcel防止大数以科学计数法显示
2021-02-05 17:00:00
在使用 PHPExcel 来进行数据导出时,常常需要防止有些数字(如手机号、身份证号)以科学计数法显示,我们可以采用下面的方式来解决:
用 setCellValueExplicit 代替 setCellValue
setCellValueExplicit 第三个参数用PHPExcel_Cell_DataType::TYPE_STRING
setCellValueExplicit(‘A1’, 13211223344, PHPExcel_Cell_DataType::TYPE_STRING);
Posted by kk
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK