note 94997 deleted from function.preg-replace-callback by danbrown
| From: | danbrown@php.net | Date: | Mon, 07 Dec 2009 18:48:54 +0000 |
| Subject: | note 94997 deleted from function.preg-replace-callback by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163678@lists.php.net to get a copy of this message | ||
Note Submitter: drewish at katherinehouse dot com
----
Matt, why bother with the regex overhead? Just do it before you output the CC number:
<?php
$cc = "0123012301239876";
$masked = substr($cc, 0, 1) . str_repeat("X", 11) . substr($cc, 12);
?>