3v4l.org

run code in 300+ PHP versions simultaneously
<?php $email = "h@hotmail.com"; $em = explode("@", $email); $name = $em[0]; echo ((strlen($name) > 3) ? substr($name, 0, 3) : "") . "***@$em[1]\n"; $email = "hag@hotmail.com"; $em = explode("@", $email); $name = $em[0]; echo ((strlen($name) > 3) ? substr($name, 0, 3) : "") . "***@$em[1]\n"; $email = "verylongemail@hotmail.com"; $em = explode("@", $email); $name = $em[0]; echo ((strlen($name) > 3) ? substr($name, 0, 3) : "") . "***@$em[1]\n";

preferences:
49.29 ms | 402 KiB | 5 Q