I know you can use str_split() to explode a string using a certain delimiter, but is it possible to split a string with more than one delimiter?
For example, could I split $mystring by space, hypen, line return, and tab chracaters all at once?
Using split().
$s = 'a-b,c.d'; $a = split('[-,.]', $s); echo '<pre>'; print_r($a); echo '</pre>';
gives
Array ( [0] => a [1] => b [2] => c [3] => d )
Very nice, thanks!