PHP code example of storagemadeeasy / contentdetectors
1. Go to this page and download the library: Download storagemadeeasy/contentdetectors library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
storagemadeeasy / contentdetectors example snippets
// Require composer autoload
rs\DetectionManager();
$matches = $manager->getMatchingTypes($content);
foreach ($matches as $match) {
// Get the match type, e.g. Passport Number
$type = $match->getMatchType();
// Get the string matches
$content = $match->getMatchingContent();
// Get any additional metadata about the maches, e.g. Credit card number type like Visa
$data = $match->getData();
}
$manager = new \SME\ContentDetectors\DetectionManager();
// Get the enabled detectors
$detectors = $manager->getDetectors();
// Disable a detector
$manager->disableDetector(\SME\ContentDetectors\Detectors\UKPhoneNumber::class);
// Enable a detector
$manager->enableDetector(\SME\ContentDetectors\Detectors\UKPhoneNumber::class);