Is there any way to explode() using an array of delimiters?
PHP Manual:
array explode ( string $delimiter , string $string [, int $limit ] )
<
function explode_by_array($delim, $input) {
$unidelim = $delim[0];
$step_01 = str_replace($delim, $unidelim, $input); //Extra step to create a uniform value
return explode($unidelim, $step_01);
}
That's improved @65Fbef05's code. We use first delimiter, because "+delim+" may be used in original string.