Re: Replace credit card numbers with X ???
| From: | Afan Pasalic | Date: | Tue, 25 Jan 2005 16:06:21 +0000 |
| Subject: | Re: Replace credit card numbers with X ??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207240@lists.php.net to get a copy of this message | ||
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