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. Link to comment https://forums.phpfreaks.com/topic/121964-solved-encrypting-numbers/ Share on other sites More sharing options...
Psycho Posted August 30, 2008 Share Posted August 30, 2008 substr($cc_number, -4); Link to comment https://forums.phpfreaks.com/topic/121964-solved-encrypting-numbers/#findComment-629570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.