Adapted from http://us3.php.net/manual/en/function.fputcsv.php#87120
X::dump(X::fromCsv(
'"141";"10/11/2002";"350.00";"1311742251"
"142";"12/12/2002";"349.00";"1311742258"'
));
// [ [ "141", "10/11/2002", "350.00", "1311742251", ], [ "142", "12/12/2002", "349.00", "1311742258", ], ]
function(string $st, $del = ';', $enc = '"', $sep = '
')
{
$r = [];
$lines = explode($sep, $st);
foreach ($lines as $line) {
$r[] = str_getcsv($line, $del, $enc);
}
return $r;
}