3v4l.org

run code in 300+ PHP versions simultaneously
<?php $email = "h@hotmail.com"; $em = explode("@",$email); $name = $em[0]; $len = strlen($name); echo substr($name,0, $len/2) . str_repeat('*', $len/2) . "@" . $em[1];

preferences:
36.43 ms | 402 KiB | 5 Q