I use this little function to trim lines if necessary:
function truncate_text($text, $nbrChar = 55, $append='...') { if (strlen($text) > $nbrChar) { $text = substr($text, 0, $nbrChar); $text .= $append; } return $text; }
I need help creating a new feature for trimming local parts of email, similar to what Google Groups did.
abc...@gmail.com
This would be especially useful for users using Facebook proxy email.
apps+2189712.12457.7b00f3c9e8bfabbeea8f73@proxymail.facebook.com
I assume that this new function will use regex to search for @ and then crop the local part by a certain number of characters to generate something like
apps+21...@proxymail.facebook.com
Any suggestions to fix this?
Thanks!
source share