1. Go to this page and download the library: Download phpfluent/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/ */
use PHPFluent\Filter\FilterInterface;
class UrlFilter implements FilterInterface
{
public function filter($value)
{
return filter_var($value, FILTER_SANITIZE_URL);
}
}
$factory = new PHPFluent\Filter\Factory();
$factory->prependPrefix('My\\Zend\\Filters\\');
PHPFluent\Filter\Builder::setDefaultFactory($factory);
$factory = new PHPFluent\Filter\Factory();
$factory->prependPrefix('My\\Zend\\Filters\\');
$builder = new PHPFluent\Filter\Builder($factory);