<?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:
$email = 'ExamplePerson+test@Gmail.com';
$bhash = md5('anon-hash:' . strtolower(preg_replace('/\+[^@]+@/', '@', $email)));
var_dump($ahash, $bhash);