romeoz/rock-sanitize
最新稳定版本:0.11.1
Composer 安装命令:
composer require romeoz/rock-sanitize
包简介
Flexible sanitizator for PHP.
README 文档
README
Features
- Sanitization of scalar variable, array and object
- Custom rules
- Standalone module/component for Rock Framework
Installation
From the Command Line:
composer require romeoz/rock-sanitize
In your composer.json:
{
"require": {
"romeoz/rock-sanitize": "*"
}
}
Quick Start
use rock\sanitize\Sanitize; Sanitize::removeTags() ->lowercase() ->sanitize('<b>Hello World!</b>'); // output: hello world!
####As Array or Object
use rock\sanitize\Sanitize; $input = [ 'name' => '<b>Tom</b>', 'age' => -22 ]; $attributes = [ 'name' => Sanitize::removeTags(), 'age' => Sanitize::abs() ]; Sanitize::attributes($attributes)->sanitize($input); /* output: [ 'name' => 'Tom', 'age' => 22 ] */ // all attributes: Sanitize::attributes(Sanitize::removeTags())->sanitize($input);
Documentation
Demo
- Install Docker or askubuntu
docker run --name demo -d -p 8080:80 romeoz/docker-rock-sanitize- Open demo http://localhost:8080/
Requirements
- PHP 5.4+
License
The Rock Sanitize is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 19.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 47
- 点击次数: 0
- 依赖项目数: 9
- 推荐数: 5
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-29