PHP code example of bermudaphp / filter

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

    

bermudaphp / filter example snippets


$nonFiltered = [1, 2, 3, null, 4, 5, null, 6, 7, 8, 9, new StdClass];

        $filter = new OneOfFilter([
            new ChainableFilter([
                new NumericFilter(),
                new EvenNumberFilter,
            ]),
            new ObjectFilter()
        ], $nonFiltered);

        dd($filter->toArray());

^ array:5 [▼
  0 => 2
  1 => 4
  2 => 6
  3 => 8
  4 => {#356}
]