Forum Moderators: coopster

Message Too Old, No Replies

How do you strip domain name from an email address?

         

neophyte

2:41 am on Aug 27, 2006 (gmt 0)

10+ Year Member



Hello All -

I need to take an email address, strip off the "@" and full domain name and then add a random number to the result.

I know how to add the random number, but I'm unsure of the easiest way to strip the "@" and full domain name since they'd all be different.

So, for example, I:

1. bozobigears@hotmail.com
2. Run it through some routine that gives me
3. "bozobigears"

I'm sure this is very elementary, but I appreciate any guidance anyone can offer.

Neophyte

jatar_k

2:55 am on Aug 27, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could just split [php.net] on the @

BarryStCyr

4:14 am on Aug 27, 2006 (gmt 0)

10+ Year Member



Why do you want to do this? It looks like you are creating email addresses to spoof email filtering programs.

Hope that's not what you are doing.

Barry

neophyte

4:19 am on Aug 27, 2006 (gmt 0)

10+ Year Member



Jatar -

Thanks for the hint. I'll try "split"

Barry -

No, I'm not trying to do anything wrong. I've heard of "spoofing" but don't know what it means or does.

This is simply to generate a hotel reservation confirmation number based upon the first half of a users email address.

Neophyte