if last element of string php 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;
}