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



Reply via email to