Easy Regex question

Posted by Aaron on Stack Overflow See other posts from Stack Overflow or by Aaron
Published on 2010-04-30T19:22:38Z Indexed on 2010/04/30 19:27 UTC
Read the original article Hit count: 169

Filed under:
|
|

Trying to replace the first 12 digits of credit card numbers with X's in a predictable blob of text that contains the string:

Credit Card Number: 1234123412341234

Here's my PHP function:

preg_replace('/Credit Card Number: ([0-9]{12})/','Credit Card Number: XXXXXXXXXXXX',$str);

Help?

© Stack Overflow or respective owner

Related posts about php

Related posts about regex