Fatal error: Cannot use object of type PHPExcel_RichText as array

上传导入Excel的时候会出现此问题,问题的原因是Excel表格中有富文本对象

2个解决思路

一个是在phpexcel获取数据的时候直接给强制转换成字符型

$data[$j][]=(string) $objPHPExcel->getActiveSheet()->getCell("$k$han")->getValue();

另外一个思路是 在导入数据的时候 对数据进行区别强制转换成字符型,如果你知道哪些字段的话,这个比较好用

$item['shop_code'] =(string) $value[];

Fatal error: Cannot use object of type PHPExcel_RichText as array的更多相关文章

  1. iwebshop (: Cannot use object of type stdClass as array in)

    今天在PHP输出一个二维数组的时候,出现了“Fatal error: Cannot use object of type stdClass as array in……”. 这个二维数组是这样的: Ar ...

  2. **PHP错误Cannot use object of type stdClass as array in错误的

    错误:将PHP对象类型当做了PHP数组  解决方法:用对象操作符-> 今天在PHP输出一个二维数组的时候,出现了“Fatal error: Cannot use object of type s ...

  3. PHP“Cannot use object of type stdClass as array” (php在调用json_decode从字符串对象生成json对象时的报错)

    php再调用json_decode从字符串对象生成json对象时,如果使用[]操作符取数据,会得到下面的错误 错误:Cannot use object of type stdClass as arra ...

  4. PHP json_decode object时报错Cannot use object of type stdClass as array

    PHP json_decode object时报错Cannot use object of type stdClass as array php再调用json_decode从字符串对象生成json对象 ...

  5. PHP“Cannot use object of type stdClass as array”

    php再调用json_decode从字符串对象生成json对象时,如果使用[]操作符取数据,会得到下面的错误 错误:Cannot use object of type stdClass as arra ...

  6. fatal error C1047: The object or library file xxx was created with an older compiler than other objects

    之前编译Cocos2DX时遇到过一次,这次又遇到了,记下解决方法,以防再来第三次. 这个错误是说链接的库或者文件是老版本编译器生成的,与当前编译器不符,比如这次用的预编译库是2015的,而我当前使用的 ...

  7. 编译Cython代码时遇到的问题: fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

    使用python setup.py build_ext --inplace命令编译cython代码, 出现以下错误: Compiling cython_example.pyx because it c ...

  8. Fatal error: Using $this when not in object context in 解决方法

    Fatal error: Using $this when not in object context in 解决方法 粗心造成的错误 $this 只存在于下面情况 $obj = new object ...

  9. fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

    xxxxxx.lib(xxxxxx.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machin ...

随机推荐

  1. arcgis api for silverlight开发系列之二:缓存图层与动态图层及图层总结 .

    本文摘自:http://blog.csdn.net/leesmn/article/details/6916458(很优秀的博客)   作为ESRI的平台的一份子arcgis api for silve ...

  2. StringUtils 正则校验

    public class StringUtils { /** * 如果str为null,返回“”,否则返回str * @param str * @return */ public static Str ...

  3. offsetParent.scrollTop IE下一直报错,说“缺少对象”

    <div style="position:fiexd; top:135px;_position: absolute; right: 0pt; _top:expression_r(off ...

  4. gdb调试libtool封装的可执行文件

    http://www.gnu.org/software/libtool/manual/html_node/Debugging-executables.html 3.4 Debugging execut ...

  5. jdk1.8的lambda语法(转)

    原文链接:http://www.jb51.net/article/115081.htm 代码: package com.jdk_8; import org.junit.Test; import jav ...

  6. L204

    Riding a bike is good exercise and great fun. But what do you do with a bike after you outgrow it? N ...

  7. centos 搭建 docker sentry

    1.安装 http://blog.51cto.com/linuxg/2052927 2 .实际调试: 项目: <title>hghh</title> <script sr ...

  8. Linux解压rar、zip、war、tar文件

    在Linux上解压常见文件的命令: rar文件:rar e xxx.rar zip文件:unzip -xzvf xxx.zip war包:jar -xvf xxx.war tar包:tar -xzvf ...

  9. HTML save data to CSV or excel

    /********************************************************************************* * HTML save data ...

  10. BZOJ4978: [Lydsy1708月赛]泛化物品(乱搞)

    4978: [Lydsy1708月赛]泛化物品 Time Limit: 5 Sec  Memory Limit: 256 MBSubmit: 220  Solved: 70[Submit][Statu ...