PHP String Exercises: Extract the user name from the specified email ID
PHP String: Exercise-6 with Solution
Write a PHP script to extract the user name from the following email ID.
Sample String : '[email protected]'
<?php $mailid = '[email protected]'; $user = strstr($mailid, '@', true); echo $user."\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