Q:

Write a PHP script to extract the user name from the following email ID

0

Write a PHP script to extract the user name from the following email ID.

Sample String : 'rayy@example.com'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$mailid  = 'rayy@example.com';
$user = strstr($mailid, '@', true);
echo $user."\n";
?>

Sample Output:

rayy

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now