I have a Social Security number showing up like this:
1234567890
I want to show it like this:
###-##-7890
So, basically, masking the first five digits and entering hyphens.
How can I do that? Thanks.
I have a Social Security number showing up like this:
1234567890
I want to show it like this:
###-##-7890
So, basically, masking the first five digits and entering hyphens.
How can I do that? Thanks.
$number = "1234567890";
$number = "###-##-".$number[7].$number[8].$number[9].$number[10];
This will take the last 4 numbers and mask the rest:
$number = "1234567890";
$number = "###-##-" . substr($number, -4);
$number = '###-##-'.substr($ssn, -4);
just make the starting part a string and concat that with the last 4 digits. Either that or do it in the query itself like SELECT CONCAT('###-##-', RIGHT(ssn, 4)) FROM customer...