PHP reading csv column into array

后端 未结 4 393
暖寄归人
暖寄归人 2021-01-12 18:52

I there a php function that enables me to read a csv column (COLUMN NOT LINE) into an array or a string ?

thank you in advance.

4条回答
  •  借酒劲吻你
    2021-01-12 19:33

    You should give fgetcsv method a try. It lets you read a file line by line and returns associative array. This function is specially for reading from CSV files.

    In any case you will have to read each line even if you will have to process just a column.

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

提交回复
热议问题