Re: Replace credit card numbers with X ???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this is my way.

       $cc_stars = '';
       $cc_no_lenght = strlen($cc_number);
       $cc_info_first4 = substr($cc_number, 0, 4);
       $cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4);
       for($i=0; $i<($cc_no_lenght-8); $i++) $cc_stars .= '*';
       $cc_number = $cc_info_first4 .$cc_stars. $cc_info_last4;


-afan

Joe Harman wrote:

Hello,

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

Thanks!
Joe




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux