stormx Posted August 30, 2008 Share Posted August 30, 2008 On my client portal, I am creating a page where users can see their credit card details. At the moment it just echoes’s the whole credit card number from the database eg: 1234123412345678 Is there a way to just echo the last 4 digits in the form of ************5678 for obvious privacy reasons? The script to get the credit card number from the database is <?php echo $user['ccnumber']; ?> So is there any way to just echo the last 4 digits? Thanks. Quote Link to comment Share on other sites More sharing options...
Psycho Posted August 30, 2008 Share Posted August 30, 2008 substr($cc_number, -4); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.