Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Partially Hide Email in Php
- This will turn great@gmail.com into g*****@g*****.com and
- myemail@gmail.co.uk will become m*******@g*****.co.uk
- and test.test@gmail.com into t*********@g*****.com
- */
- <?php
- $email = preg_replace('/(?:^|@).\K|\.[^@]*$(*SKIP)(*F)|.(?=.*?\.)/', '*', $email);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement