Support the ongoing development of Laravel.io →
posted 10 years ago
Views
Last updated 2 years ago.
0

If you are trying to protect your email against email scrapers, just use HTML::email('[email protected]'). This obfuscates email so the actual address does not appear as such in the 'source'.

If you really want to suppress display of full email address, a php function like the following can be used:

//$input is the email address and $show is the number of characters you want displayed.. defaults to 3
function hideEmail($input,$show=3) {
   $arr = explode('@', $input);
   return substr($arr[0],0,$show).str_repeat('*',strlen($arr[0])-$show).$arr[1];
}

Hope this helps!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

marijang marijang Joined 20 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.