<?php /** * This file is part of Pachico/Magoo. (https://github.com/pachico/magoo) * * @link https://github.com/pachico/magoo for the canonical source repository * @copyright Copyright (c) 2015-2016 Mariano F.co Benítez Mulet. (https://github.com/pachico/) * @license https://raw.githubusercontent.com/pachico/magoo/master/LICENSE.md MIT */ require __DIR__ . '/../vendor/autoload.php'; use Pachico\Magoo\Magoo; $magoo = new Magoo(); $magoo->pushCreditCardMask('·'); $mySensitiveString = 'This is my credit card number: 4111 1111 1111 1111.'; echo $magoo->getMasked($mySensitiveString . PHP_EOL); // This is my credit card number: ······1111.
<?php /** * This file is part of Pachico/Magoo. (https://github.com/pachico/magoo) * * @link https://github.com/pachico/magoo for the canonical source repository * @copyright Copyright (c) 2015-2016 Mariano F.co Benítez Mulet. (https://github.com/pachico/) * @license https://raw.githubusercontent.com/pachico/magoo/master/LICENSE.md MIT */ require __DIR__ . '/../vendor/autoload.php'; use Pachico\Magoo\Magoo; $magoo = new Magoo(); $magoo->pushCreditCardMask()->pushEmailMask()->pushByRegexMask('/(email)+/m'); $mySensitiveString = 'My email is roy@trenneman.com and my credit card is 6011792594656742'; echo $magoo->getMasked($mySensitiveString . PHP_EOL); // 'My ***** is ***@trenneman.com and my credit card is ************6742'
<?php /** * This file is part of Pachico/Magoo. (https://github.com/pachico/magoo) * * @link https://github.com/pachico/magoo for the canonical source repository * @copyright Copyright (c) 2015-2016 Mariano F.co Benítez Mulet. (https://github.com/pachico/) * @license https://raw.githubusercontent.com/pachico/magoo/master/LICENSE.md MIT */ require __DIR__ . '/../vendor/autoload.php'; use Pachico\Magoo\Magoo; $magoo = new Magoo(); $magoo->pushCreditCardMask()->pushByRegexMask('(\\d+)', '_'); $mySensitiveString = 'My CC is 4111 1111 1111 1111 and my telephone number is 639.639.639.'; echo $magoo->getMasked($mySensitiveString . PHP_EOL); // My CC is ************____ and my telephone number is ___.___.___. $magoo->reset(); echo $magoo->getMasked($mySensitiveString . PHP_EOL); // My CC is 4111 1111 1111 1111 and my telephone number is 639.639.639.