Q:

I want to convert a email address to xxx.xxx@gmail.com in php

I have dynamically generated email id 
say testing1234.gjj@gmail.com .
I want to convert email id to xxxxxxxxxx.xxx@gmail.com .
Please tell me how can i implement this in php  for any email address .

A:

Try with following simple way, by using explode() function you will get email domain and you can easily append that domain to new email address as follow.
<?php
    $strEmail = "testing1234.gjj@gmail.com";

    $arrEamil = explode("@", $strEmail);
    $arrReverse = array_reverse($arrEamil);
    $strEamilDomain = $arrReverse[0];

    if ($strEamilDomain != "") {
        $strNewEmail = "xxxxxxxxxx.xxx@".$strEamilDomain;
    }
    echo $strNewEmail;
?>

