$email = 'divakar.kumar6@gmail.com'; $email = substr_replace($email,"xxxxxxxxxx",3,10); $contact = "9899784414"; $contact = substr_replace($contact,"xxxxxx",2,6); echo $email; echo "<br/>"; echo $contact;