I'm still trying to figure out a way to take into account escaped quotes like "test\";nosplit"
or 'test\';nosplit'
So far I have something like this:
preg_split('#(^;)|(;$)|(?<!["\'\\]);#', $str_to_split);
But it's not even working on something as simple as: test; 1; 2; '34;34'; wtvr
I want it to split on these:
v v v v
test; 1; 2; '34;34'; wtvr
v v v v
test; 1;2; '34\'34;34'; wtvr
v v v v
test; 1;2; "34\"34;34"; wtvr
v v v v
test; 1;2; '34\"34;34'; wtvr
v v v v
test; 1;2; "34\'34;34"; wtvr
v v v v
test; 1;2; "3 4 \' 3 4 ; 3 4"; wtvr
How can I make this work?