Forum Moderators: coopster

Message Too Old, No Replies

mask emails using php

         

varunkrish

10:00 am on Jun 7, 2005 (gmt 0)

10+ Year Member



is there anyway to convert
abc@mail.com to abc at mail dot com using php

i have seen at php.net and other sites..please help as i am a newbie to php

dcrombie

11:24 am on Jun 7, 2005 (gmt 0)



Something like this?

$input = "abc@example.net"; 
$input = str_replace("@", " at ", $input);
$input = str_replace(".", " dot ", $input);

;)

coopster

6:20 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If you are using PHP > 4.3.3, you can use arrays as parameters (using arrays prior to that version was buggy):
$input = "abc@example.net";  
$input = str_replace(array('@', '.'), array(' at ', ' dot '), $input);

varunkrish

10:28 pm on Jun 7, 2005 (gmt 0)

10+ Year Member



thanks

i did this

$email2=eregi_replace("@"," at ",$email);
$email3=eregi_replace(".com"," dot com ",$email2);
$email=email3;

LOL

thanks

u made my code a single line