Hello, I was just wondering how i could change the first 12 numbers in a credit card into x's? for display on a secure page. I only wish to show the last 4 digits. I figured a while or for loop would be best. But i was just wondering if any one has seen a post or tutorial they could point me to for reference? Thanks Antoni
Imagine that you have a string called $cc_num that is 16 digits long. All you have to do is connect the last 4 digits of the cc number to 12 X's like this:
$protected_cc_num = "XXXX XXXX XXXX " . substr($cc_num,12,4);
excellent.. thanks for the help i will give it a try!