BR
asked on
masking php string
I have a variable that holds the name and surname of the my user
I want to print the name on the screen with a mask like
$name=John Lanon
I'd like to show the only first letters and the others should be * instead of letter
I'd like to print it like J*** L****
I want to print the name on the screen with a mask like
$name=John Lanon
I'd like to show the only first letters and the others should be * instead of letter
I'd like to print it like J*** L****
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is one of those questions with many paths to a solution, and also with many layers of underlying questions. A good strategy might be to set up a test script that would allow you to test any new solution with a collection of names. String processing is hard to get right because the incoming strings have so many variances, and our code needs to account for almost infinite variability.
The "rules" for English-language names permit such things as Leonard Pinth-Garnell, Dr. James Madison, BGen Warren Woods, Richard Allen, Jr., W. David Lawson, IV, Jack O'Rourke, Paul McDuffie, etc. and the final algorithm you choose would need to make sensible outputs from a variety of names.
The "rules" for English-language names permit such things as Leonard Pinth-Garnell, Dr. James Madison, BGen Warren Woods, Richard Allen, Jr., W. David Lawson, IV, Jack O'Rourke, Paul McDuffie, etc. and the final algorithm you choose would need to make sensible outputs from a variety of names.
ASKER
thank you Ray,
I'll read your article tonight.
I'll read your article tonight.
ASKER
thank you so much