I have the following string from a form...
Opera "adds cross-platform hardware" "kicks butt" -hippies
In general I've simply been using the following...
$p0 = explode(' ',$string);
However now I want to maintain any and all quote operators as a single array item instead of having them create individual items like "adds
, cross-platform
and hardware"
.
I want to have that string end up creating an array like this...
Array
(
[0] => 'Opera',
[1] => 'adds cross-platform hardware',
[2] => 'kicks butt',
[3] => '-hippies'
)
I generally prefer to not use regex for most things whenever possible.