如何从PHP中的csv文件中提取数据
我有一个csv文件,看起来像这样
$lines[0] = "text, with commas", "another text", 123, "text",5;
$lines[1] = "some without commas", "another text", 123, "text";
$lines[2] = "some text with commas or no",, 123, "text";
我想有一个表:
$t[0] = array("text, with commas", "another text", "123", "text","5");
$t[1] = array("some without commas", "another text", "123", "text");
$t[2] = array("some text, with comma,s or no", NULL , "123", "text");
如果我使用,我会得到有什么优雅的方法来做到这一点吗?split($lines[0],",")
"text" ,"with commas" ...