How to Partially hiding an email address using PHP regex

In this tutorial, I will show you how to email address partially using PHP regex. Many PHP project needs this type of specialty. I want to display email from a database and I want to only show some character not an all. You may also likeĀ How to Call jquery ajax in Codeigniter php

PHP Code

$email = '';
echo $email = preg_replace('/(?:^|@).\K|\.[^@]*$(*SKIP)(*F)|.(?=.*?\.)/', '*', $email);



And if you like these tutorials please share it with your friends via Email or Social Media.

Leave a Reply

Your email address will not be published. Required fields are marked *