使用array_chuck csv无法上传

时间:2016-06-24 08:55:12

标签: php arrays csv fgetcsv

任何人都知道如何解决这个问题 ff。代码必须是csv格式

sample.csv

[one] [two] [three] =第1行
[四] [五] [六] =第二行

我试图分裂ff。使用ff代码的数据,我得到了这个结果

 print_r( array_chunk(fgetcsv($handle,1000,","),3) );

  Array ( 
     [0] => Array ( 
             [0] => one
             [1] => two
             [2] => three four
          ) 
     [1] => Array ( 
             [0] => five
             [1] => six
          ) 
      )

我希望结果必须像这样

  Array ( 
     [0] => Array ( 
             [0] => one
             [1] => two
             [2] => three
          ) 
     [1] => Array ( 
             [0] => four
             [1] => five
             [2] => six
          ) 
      )

0 个答案:

没有答案