It's really simple with the native, versatile function substr() of PHP:

PHP Code:
$str 'This is a great day!';
echo 
substr($str, -1); 
Which will simply output:

Code:
!
Because the negative starting point -1 positions the starting point of the substring at the end of the subject string. If you know the length of the ending string, you can check if a multiple-character string is at the very end of the original string.

PHP Code:
$endStr 'ay!';
$endStrLen strlen($endStr);
$str 'This is a great day!';
if (
substr($str, -$endStrLen) == $endStr) {
  echo 
'yes';

Which will output:

Code:
yes