如何将XLXS Excel数据更改为多维数组

时间:2017-05-09 05:37:31

标签: php arrays excel multidimensional-array

enter image description here

如何将此XLXS excel文件转换为以下数组格式。我还附上了Excel文件的截图。请查看它并告诉我

我正在使用这个库从我在下面提到的Excel文件中获取数据: -

require_once "EXCEL/simplexlsx.class.php";
$xlsx = new SimpleXLSX('EXCEL/Testingexcel.xlsx');
Excel Array
$xlsx->rows()

阵 (     [0] =>排列         (             [0] =>科/部门             1 =>笔记             [2] =>没有             [3] =>优惠             [4] =>码             [5] =>使用照片             [6] =>项目编号             [7] =>英文说明             [8] =>希腊描述             [9] =>价格来自             [10] =>价钱             [11] =>文本1             [12] =>独家品牌             [13] =>日期来自             [14] =>日期到         )

[1] => Array
    (
        [0] => Chair
        [1] => Cover
        [2] => 1
        [3] => 
        [4] => 
        [5] => 
        [6] => 
        [7] => etge
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[2] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP1
        [5] => 
        [6] => 
        [7] => wefewf
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[3] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP2
        [5] => 
        [6] => 
        [7] => TITLE 1
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[4] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP3
        [5] => 
        [6] => 
        [7] => TITLE 12
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[5] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP4
        [5] => 
        [6] => 
        [7] => TITLE 13
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[6] => Array
    (
        [0] => 
        [1] => 
        [2] => 2
        [3] => 
        [4] => AP5
        [5] => 
        [6] => 
        [7] => TITLE 14
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[7] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP6
        [5] => 
        [6] => 
        [7] => TITLE 15
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[8] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP7
        [5] => 
        [6] => 
        [7] => TITLE 16
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[9] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP8
        [5] => 
        [6] => 
        [7] => TITLE 17
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[10] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP9
        [5] => Y
        [6] => 
        [7] => TITLE 18
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[11] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP10
        [5] => 
        [6] => 
        [7] => TITLE 19      
        [8] => 
        [9] => 
        [10] => 
        [11] => 40%
        [12] => 
        [13] => 
        [14] => 
    )

[12] => Array
    (
        [0] => Table
        [1] => cover
        [2] => 2
        [3] => 
        [4] => 
        [5] => 
        [6] => 
        [7] => TITLE 20
        [8] => 
        [9] => 
        [10] => 
        [11] => 1+1
        [12] => 
        [13] => 
        [14] => 
    )

[13] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP11
        [5] => 
        [6] => 
        [7] => TITLE 145
        [8] => 
        [9] => 
        [10] => 
        [11] => 1+1
        [12] => 
        [13] => 
        [14] => 
    )

[14] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => AP12
        [5] => 
        [6] => 
        [7] => TITLE 1657
        [8] => 
        [9] => 
        [10] => 
        [11] => 1+1
        [12] => 
        [13] => 
        [14] => 
    )

[15] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => 
        [5] => 
        [6] => 
        [7] => 
        [8] => 
        [9] => 
        [10] => 
        [11] => 
        [12] => 
        [13] => 
        [14] => 
    )

[16] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => 
        [5] => 
        [6] => 
        [7] => 
        [8] => 
        [9] => 
        [10] => 
        [11] => 
        [12] => 
        [13] => 
        [14] => 
    )

[17] => Array
    (
        [0] => 
        [1] => 
        [2] => 
        [3] => 
        [4] => 
        [5] => 
        [6] => 
        [7] => 
        [8] => 
        [9] => 
        [10] => 
        [11] => 
        [12] => 
        [13] => 
        [14] => 
    )

foreach ($xlsx->rows() as $key => $valueRows){

}




Array [0] => Array
(  
   [chair] => Array
        (
        [offer 1] => Array
            (
                [0] => AP1
                [1] => AP2
                [2] => AP3
                [3] => AP4
            )

        [offer 2] => Array
            (
                [0] => AP5
                [1] => AP6
                [2] => AP7
                [3] => AP8
                [4] => AP9
            )
         )

    [table] => Array
        (    
        [offer 1] => Array
            (
                [0] => AP10

            )


         ) 
 ) 

0 个答案:

没有答案