I have tried a few things to get a last part out I done this:
$string = \'Sim-only 500 | Internet 2500\'; preg_replace(\"Sim-Only ^([1-9]|[1-9][0-9]|[1-9][0-
If you want to wrap the last word with a span:
' . $pieces[count($pieces)-1] . ''; // Returns the glued pieces return implode(" ", $pieces); } wrap_last_word('hello this is wrapped'); // returns this: // hello this is wrapped