- }else $a[$id].=$str[$i]; //add to current element in array
- }else if ($in_quote){
- if ($str[$i]=="\\") $i++; //escape backslashes
- else $a[$id].=$str[$i]; //add to current element in array
+ } else
+ $a[$id].=$str[$i]; //add to current element in array
+ } else if ($in_quote) {
+ if ($str[$i]=="\\") {
+ $i++; //escape backslashes
+ if ($str[$i] == '"' || $str[$i] == "\\")
+ $a[$id] .= $str[$i];
+ } else
+ $a[$id] .= $str[$i]; //add to current element in array