PHP code example of flatphp / filter

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

    

flatphp / filter example snippets


use Flatphp\Filter\Sanitizer;

// simple
$value = Sanitizer::stripChars('hello', 'e');

// single value
$value = Sanitizer::sanitize('test/', 'strtoupper|trim:/');

// multiple value
$data = ['aa' => 22.12, 'bb' => 34.1789, 'cc' => ' HELLO '];
$data = Sanitizer::sanitize($data, array(
    'aa' => 'intval',
    'bb' => 'float:2',
    'cc' => 'strtolower|trim|stripChars:e'
));