Reputation: 523
str_getcsv("test\\.a.b", ".", "'", "\\");
I would expect the above to equal ["test.a", "b"]
, however it equals ["test\", "a", "b"]
. Am I misunderstanding the purpose or usage of the $escape
argument? I want to escape the separator such that the result is the former array.
Upvotes: 0
Views: 65
Reputation: 19780
You could use the "enclosure" char to enclose a separator char:
var_dump(str_getcsv("'test.a'.b", ".", "'", "\\"));
Output:
array(2) {
[0]=>
string(6) "test.a"
[1]=>
string(1) "b"
}
Upvotes: 1