alonity/filter

Alonity 过滤器

dev-main 2022-05-14 21:15 UTC

This package is auto-updated.

Last update: 2024-09-15 02:30:15 UTC


README

过滤器组件

安装

composer require alonity/filter

示例

use alonity\filter\Filters;

require('vendor/autoload.php');

$filterHost = Filters::server('HTTP_HOST', '[^a-z0-9\.\-]')->get();

$filterArray = Filters::getArray([
    'example' => [
        'regexp' => '[^\d]'
    ],
    'test' => [
        'regexp' => '[^\w]',
        'maxLength' => 10
    ]
]);

$results = $filterArray->get();

文档:https://alonity.gitbook.io/alonity/components/filter