What is the correct regular expression to archive the desired result? Hence, empty fields in $str may or may not be surrounded by ""
$str='"Value","Value, containing delimiter","","End"';
$regEx="/,/";
print_r(preg_split($regEx,$str));
Output:
Array
(
[0] => "Value"
[1] => "Value
[2] => containing delimiter"
[3] => ""
[4] => "End"
)
Desired output:
Array
(
[0] => "Value"
[1] => "Value, containing delimiter"
[2] => ""
[3] => "End"
)