zang8027 Posted July 30, 2008 Share Posted July 30, 2008 ok, so for my portfolio, I have a php site. What i want to know is how to only show a certain part of what the user submitted (credit card) So say the user put in 1234567 as his or her credit card number. On the confirmation page, I want it to say: XXXXX67 How can I do that ??? Quote Link to comment Share on other sites More sharing options...
ratcateme Posted July 30, 2008 Share Posted July 30, 2008 use substr() $card = "xxxxx".substr($card_num,5,2); Scott. Quote Link to comment Share on other sites More sharing options...
derekmcd Posted July 30, 2008 Share Posted July 30, 2008 $cardnum = "XXXXXX".substr($_POST['creditcard_num'], -2); Quote Link to comment Share on other sites More sharing options...
vikramjeet.singla Posted July 30, 2008 Share Posted July 30, 2008 you can try this as well: $var = "4111111111111111"; print str_repeat("x", strlen($var)-4).substr($var, strlen($var)-4, strlen($var)); 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.