I have using cakephp and I want to obscure all numbers which is more than six digits.
something like this
$string = "My id number is 77765444 in Sales dept.";
becomes
$string = "My id number is XXXXXXXX in Sales dept."
I appreciate any help.
Thanks.
Try this using
preg_replace_callbackand an anonymous function:The anonymous function is used to replace each occurrence of six or more consecutive digits by the same amount of
X. If your PHP version does not support anonymous functions (available since 5.3), use a normal function instead.