Here is another way to get the last word from a string
$my_string = "fetch the last word from me";
// Explode the string into an array
$my_string = explode(" ", $my_string);
// target the last word with end() function
$my_string = end($my_string);
echo $my_string;