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?