PHP String Exercises: Get the last three characters of a string
PHP String: Exercise-7 with Solution
Write a PHP script to get the last three characters of a string.
Sample String : '[email protected]'
<?php $str1 = '[email protected]'; echo substr($str1, -3)."\n"; ?>
PHP Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?