Using str_getcsv() but with multiple delimiters? e.g. both tabs and commas

I’d like to split a string into an array using a function like str_getcsv(), but where you can pass in multiple delimiters. For instance you’d pass in array(“,”, "\ ") to set both commas and tabs as delimiters. And you would pass the enclosure and escape characters, just as in str_getcsv().

Is there a function or library that can do this?

Well I dont know about enclosure/escape, but wouldnt the splitting just be…

$array = preg_split(/[,\ ]/,$stringin);


Yes, but the ability to enclose and escape is important. For instance:

First,“This is, a sentence”,“This is, a quote: \”",Last

Should be exploded to:
This is, a sentence
This is, a quote: "