3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $email = 'ExamplePerson+test@Gmail.com'; // Remove email tags, value will become 'ExamplePerson@Gmail.com' $email = preg_replace('/\+[^@]+@/', '@', $email); // Convert uppercase letters, value will become 'exampleperson@gmail.com' $email = strtolower($email); // Add prefix, value will become 'anon-hash:exampleperson@gmail.com' $email = 'anon-hash:'. $email; // Make the hash, value will become '56f1902ef780b12430ae194290057a40' $ahash = md5($email); // Or, in short: $bhash = md5('anon-hash:' . strtolower(preg_replace('/\+[^@]+@/', '@', $email))); var_dump($ahash, $bhash);
based on 8Z4f9
Output for 4.3.0 - 7.1.0
string(32) "56f1902ef780b12430ae194290057a40" string(32) "fdcf049679817fa7b2191fa64fcbc906"