Created
September 11, 2018 15:28
-
-
Save voidnerd/dee663af4bae51fdc143209527f12957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function encrypt($str, $num){ | |
$len = strlen(substr($str, $num, strlen($str) - $num)); | |
$goin = str_repeat('*', $len); | |
$res = substr($str, 0 , $num) .$goin . substr($str, $len, strlen($str)); | |
return $res; | |
} | |
print(encrypt("1111111111111111111111", 4)); //1111******************1111 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment