3v4l.org

run code in 300+ PHP versions simultaneously
<?php function maskString($string) { return preg_replace('/(?<=.)','*',$string); } function maskEmail($email) { $arremail = explode('@',$email); //$email1 = preg_replace('/(?<=.).(?=.*@)/u','*',$arremail[0].'@'); //$email2 = preg_replace('/(?<=.).(?=.*[.])/u','*',$arremail[1]); //return $email1.$email2; return maskString($arremail[0]); } $email = 'facebook@yahoo.co.id'; $result = maskEmail($email); echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_replace(): No ending delimiter '/' found in /in/9Vebt on line 4

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.64 ms | 401 KiB | 8 Q