PHP preg_split with two delimiters and capture only one
问题 Really poor at regular expressions, sorry in advance! I've tried my best to work out how to split a string into a array with two delimiters and still capture one and include it in the final array. preg_split seems ideal for this but my regular expression is letting me down. If for example, I've the string foo = bar AND bar=foo ; I want to split the string at either a space, or the = character BUT keep the = so the array would look like: Array ( [0] => foo [1] => = [2] => bar [3] => AND [4] =>