<?php function mailObfuscate($mail) { //every second character replace with * $mail = explode('@',$mail); $array = str_split($mail[0]); $control = 0; $ret = ''; foreach ($array as $char) { if ($control == 0) { $ret .= '*'; } else { $ret .= $char; } $control = !$control; } return $ret.'@'.$mail[1]; } echo mailObfuscate("realname_x123@gmail.com");
You have javascript disabled. You will not be able to edit any code.