|
-
Jan 26th, 2012, 06:33 PM
#1
Thread Starter
Fanatic Member
Remove "." and "@" from email address?
Hi guys,
Imagine i have this in my php code
$email = "[email protected]"
is it possible to echo out the first part of the email address turning it to
JamieWarren
so removing any fullstops and not echoing the last part of the email?
Thanks
Jamie
-
Jan 26th, 2012, 10:28 PM
#2
Re: Remove "." and "@" from email address?
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 27th, 2012, 05:00 AM
#3
Re: Remove "." and "@" from email address?
I would use explode() myself since I dont know regular expressions! This works assuming the email is formatted correctly.
PHP Code:
$email = "[email protected]"; $explode = explode('@', $email);
$username = $explode[0]; $domain = $explode[1];
echo $username; // prints dclamp
echo $domain; // prints yahoo.com
-
Jan 28th, 2012, 07:06 AM
#4
Re: Remove "." and "@" from email address?
Didnt notice you wanted to remove the period. Just use str_replace():
PHP Code:
$email = str_replace(".", "", $email);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|