У меня есть 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" ...
Есть ли какой-нибудь элегантный способ сделать это?