note 47282 deleted from function.str-replace by didou
| From: | didou@php.net | Date: | Wed, 10 Nov 2004 13:38:37 +0000 |
| Subject: | note 47282 deleted from function.str-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80350@lists.php.net to get a copy of this message | ||
Note Submitter: mike at goomzee dot com
----
For printing invoices with only the last 4 digits of a credit card showing, we used both str_repeat
and str_replace functions as follows:
<?php echo substr_replace($var, str_repeat("*", strlen($var)-4), 0, -4); ?>
$var being the raw credit card number and '*' being the desired placeholder for the other
digits.
Enjoy! Mike Sparr - Goomzee Web Services (http://www.goomzee.com)
----
Reason: contains commercial links