how to import CSV using zend

前端 未结 4 354
故里飘歌
故里飘歌 2021-02-04 09:36

How do I import CSV files using zend framework? Should I use zend_file_transfer or is there any special class that I have to look into? Also if I use zend_file_transfer is there

4条回答
  •  太阳男子
    2021-02-04 10:25

    You could also use SplFileObject for reading CSV files.

    From the php manual:

    setFlags(SplFileObject::READ_CSV);
        foreach ($file as $row) {
            list($animal, $class, $legs) = $row;
            printf("A %s is a %s with %d legs\n", $animal, $class, $legs);
        }
    ?> 
    

    http://php.net/manual/en/splfileobject.fgetcsv.php

提交回复
热议问题