PHP code example of wyrihaximus / psr-3-keyword-filter

1. Go to this page and download the library: Download wyrihaximus/psr-3-keyword-filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wyrihaximus / psr-3-keyword-filter example snippets


$keywords = ['bad', 'evil'];
$monolog = new Monolog();
$filterredLogger = new MessageKeywordFilterLogger($keywords, $monolog);
$filterredLogger->info('bad'); // Won't reach monolog
$filterredLogger->info('good'); // Will reach monolog
$filterredLogger->info('evil'); // Won't reach monolog