Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tips How to Partially hide email address using PHP
#1
In this tutorial i will show you how to partially hide email address using php. Many php project need this type speciality. like I want to display email from database and I want to only show some character not a all. 


PHP Code
Code:
<?php
   function partially_email($email)
   {
       $em   = explode("@",$email);
       $name = implode(array_slice($em, 0, count($em)-1), '@');
       $len  = floor(strlen($name)/2);
       return substr($name,0, $len) . str_repeat('*', $len) . "@" . end($em);  
   }

   $email = 'kingsolomon1717@gmail.com';
   echo partially_email($email);
?>

Output
Code:
kingsolom******@gmail.com

And if you like this tutorials please share it with your friends via Email or Social Media.
To Purchase Credit Click here , For how to make money on Sologet forum Click here . 
There is love in sharing
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  How to Stop Sending E-Mail Spam using PHP mail function Kingsolomon 1 59 11-12-2018, 04:38 PM
Last Post: Solomon
  Multiple file upload in php Kingsolomon 1 67 11-08-2018, 03:01 PM
Last Post: Solomon
  How to limit text length in php and provide 'Read more' link Kingsolomon 0 48 10-31-2018, 02:08 PM
Last Post: Kingsolomon
  How to read more / hide text using Jquery and PHP Kingsolomon 0 40 10-31-2018, 02:06 PM
Last Post: Kingsolomon
  Download simple HTML email templates Kingsolomon 0 43 10-31-2018, 02:05 PM
Last Post: Kingsolomon

Forum Jump:


Users browsing this thread:
1 Guest(s)


Users that viewed this thread:
1 User(s) read this thread:
Kingsolomon
How to Partially hide email address using PHP00