What I would do is reverse the string and work from that: <?php // String $string = "Enter whatever here"; // Reverse the string so you can get the last letter/character easily $reverse = strrev( $string ); // Echo or do whatever with it echo $reverse{0}; ?> PHP: The above would return / echo "e". Hope that helps.
There is an example for that in the PHP Manual: // Get the last character of a string. $str = 'This is still a test.'; $last = $str[strlen($str)-1]; PHP: http://www.php.net/manual/en/language.types.string.php#language.types.string.substr