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
<?php
$email = 'youremailaddrss@website.com';
echo $email = preg_replace('/(?:^|@).\K|\.[^@]*$(*SKIP)(*F)|.(?=.*?\.)/', '*', $email);
?>
Output
y************@w*****.com
And if you like these tutorials please share it with your friends via Email or Social Media.