How to explode only on the last occurring delimiter?
How about this:
$parts = explode($split_point, $string);$last = array_pop($parts);$item = array(implode($split_point, $parts), $last);
Not going to win any golf awards, but it shows intent and works well, I think.
Here is another way of doing it:
$split_point = ' - ';$string = 'this is my - string - and more';$stringpos = strrpos($string, $split_point, -1);$finalstr = substr($string,0,$stringpos);