romeoz/rock-sanitize 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

romeoz/rock-sanitize

最新稳定版本:0.11.1

Composer 安装命令:

composer require romeoz/rock-sanitize

包简介

Flexible sanitizator for PHP.

README 文档

README

Latest Stable Version Total Downloads Build Status HHVM Status Coverage Status License

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

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

GitHub 信息

  • Stars: 47
  • Watchers: 9
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-29