解决方案 »

  1.   

    没有看到乱码
    截图中的是你 var_dump 的结果
      

  2.   

    Excel文件中的数据都是正常的,但是在读取的时候中间会有一部分读取出类似于“(12) { ["_name":protected]=> string(6) "宋体" ["_size":protected]=> int(12) ["_bold":protected]=> bool(false) ["_italic":protected]=> bool(false) ["_superScript":protected]=> bool(false) ["_subScript":protected]=> bool(false) ["_underline":protected]=> string(4) "none" ["_strikethrough":protected]=> bool(false) ["_color":protected]=> object(PHPExcel_Style_Color)#3006 (4) { ["_argb":protected]=> string(8) "FF000000" ["_parentPropertyName":protected]=> NULL ["_isSupervisor":protected]=> bool(false) ["_parent":protected]=> NULL } ”这样的数据。正常的数据输出应该是[2]=> array(13) { [0]=> string(6) "B01001" [1]=> string(6) "超市" [2]=> string(12) "百佳超市" [3]=> string(6) "广东" [4]=> string(6) "广州" [5]=> string(21) "广州中华广场店" [6]=> string(51) "广州越秀区中山三路228号中华广场三层" [7]=> NULL [8]=> NULL [9]=> NULL [10]=> NULL [11]=> float(2735) [12]=> string(6) "caoshi" } [3]=> array(13) { [0]=> string(6) "B01002" [1]=> string(6) "超市" [2]=> string(12) "百佳超市"  这种格式。
      

  3.   

    我也有时候会碰到乱码,有时候又是好的,估计是微软excel问题。
      

  4.   

    Excel文件中的数据都是正常的,但是在读取的时候中间会有一部分读取出类似于“(12) { ["_name":protected]=> string(6) "宋体" ["_size":protected]=> int(12) ["_bold":protected]=> bool(false) ["_italic":protected]=> bool(false) ["_superScript":protected]=> bool(false) ["_subScript":protected]=> bool(false) ["_underline":protected]=> string(4) "none" ["_strikethrough":protected]=> bool(false) ["_color":protected]=> object(PHPExcel_Style_Color)#3006 (4) { ["_argb":protected]=> string(8) "FF000000" ["_parentPropertyName":protected]=> NULL ["_isSupervisor":protected]=> bool(false) ["_parent":protected]=> NULL } ”这样的数据。正常的数据输出应该是[2]=> array(13) { [0]=> string(6) "B01001" [1]=> string(6) "超市" [2]=> string(12) "百佳超市" [3]=> string(6) "广东" [4]=> string(6) "广州" [5]=> string(21) "广州中华广场店" [6]=> string(51) "广州越秀区中山三路228号中华广场三层" [7]=> NULL [8]=> NULL [9]=> NULL [10]=> NULL [11]=> float(2735) [12]=> string(6) "caoshi" } [3]=> array(13) { [0]=> string(6) "B01002" [1]=> string(6) "超市" [2]=> string(12) "百佳超市"  这种格式。
      

  5.   

    问题已经解决了。是因为读取单个cell的内容,读取的结果可能是object类型,也可能是string类型,加上一个判断,修改下类型就好了。