3Y25 发表于 2013-3-18 15:30:47

刚使用phpExcel导出文档数据,结果出现了这种,怎么能解决?

刚使用phpExcel导出文档数据,结果出现了这种,怎么能解决?
其实我只想读E出单元格里面的string变量就可以了,结果弄出这么复杂的对象数据,怎么能解决呢?太头痛了。

Array
(
    => 世达机械制造厂
    => http://www.hbtdhtsss.com
    => 广东
    => 东莞
    => PHPExcel_RichText Object
      (
             => Array
                (
                   => PHPExcel_RichText_TextElement Object
                        (
                            => 求指指教
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => Arial Unicode MS
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            =>
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => 宋体
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            => :为什么
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => Arial Unicode MS
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            => PHP
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => 宋体
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            => 用
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => Arial Unicode MS
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            =>excel
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => 宋体
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            => 导入数据最多可以导入
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => Arial Unicode MS
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            => 137
                        )

                   => PHPExcel_RichText_Run Object
                        (
                            => PHPExcel_Style_Font Object
                              (
                                     => 宋体
                                     => 10
                                     =>
                                     =>
                                     =>
                                     =>
                                     => none
                                     =>
                                     => PHPExcel_Style_Color Object
                                        (
                                           => FF000000
                                           =>
                                           =>
                                           =>
                                        )

                                     =>
                                     =>
                                     =>
                                     => 32767
                              )

                            => 条,是不是哪里有设置的呢
                        )

                )

      )

)

jeongee 发表于 2013-3-18 16:19:36

本帖最后由 jeongee 于 2013-3-18 16:42 编辑

这个是由于那个单元格设置了格式造成的,查查手册吧,还有对应方法获取到的那个text值的
我以前弄过,现在忘了 {:soso_e100:}

jeongee 发表于 2013-3-18 16:47:17

我查了一下,是getPlainText(),你判断一下,是不是string如果不是就用getPlainText()取一下就可以了。
页: [1]
查看完整版本: 刚使用phpExcel导出文档数据,结果出现了这种,怎么能解决?