Jump to content


Photo

Regex Email Replace


  • Please log in to reply
No replies to this topic

#1 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 12 April 2006 - 10:12 PM

hey i got a piece of code here that will replace a email such as username@yoursite.com to username at yoursite dot com but im having a bit of problem it is cutting of the first letter in each word so itl put out sername at oursite dot om
$email = "eric@yahoo.com";
      $email_array_search = array(
         
           '/[a-zA-Z0-9](.*?)[@](.*?)[a-zA-Z0-9-](.*?)[\.](.*?)[com|net|biz|org|tv|info](.*?)/is',
       
      );
      
      $email_array_replace = array(
      
           '$1 at $3 dot $5',
      
      );
      
      $email = preg_replace($email_array_search,$email_array_replace,$email);
      
      echo $email;

NM I GOT THIS IM DUMB>.......




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users