Hi I have a list of email on my DB and I want only to show the name before the @ symbol ex: ---will become----> username (all characters before @ symbol will only display) I hope someone will help me TIA!
<?php $email = "username@gmail.com"; $arr = explode("@", $email); //outputs username... echo $arr[0]; ?> PHP:
<?php $string = "j@j.com"; $token = strtok($string, "@"); while ($token != false) { echo "$token<br />"; $token = strtok("@"); } ?>