PHP code example of district5 / filter

1. Go to this page and download the library: Download district5/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/ */

    

district5 / filter example snippets



use \District5\Filter\FilterInterface;

class MyStringToLowerFilter implements FilterInterface
{
    public function filter($value)
    {
        if (extension_loaded('mbstring')) {
            return mb_strtolower($value);
        }

        return strtolower($value);
    }
}