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?
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework