php get last two words in strin code example
Example: get last word from string php
function getLastWord($string)
{
$string = explode(' ', $string);
$last_word = array_pop($string);
return $last_word;
}
function getLastWord($string)
{
$string = explode(' ', $string);
$last_word = array_pop($string);
return $last_word;
}