00f100/fcphp-sinput
Composer 安装命令:
composer require 00f100/fcphp-sinput
包简介
Package to clean input content
README 文档
README
Package to clean input content
How to install
Composer:
$ composer require 00f100/fcphp-sinput
or add in composer.json
{
"require": {
"00f100/fcphp-sinput": "*"
}
}
How to use
<?php use FcPhp\SInput\SInput; use FcPhp\SInput\Rules\AddSlashes; use FcPhp\SInput\Rules\HtmlEntities; use FcPhp\SInput\Rules\StripTags; $instance = new SInput(); $instance->addRule('addslashes', new AddSlashes()); $instance->addRule('htmlentities', new HtmlEntities()); $instance->addRule('striptags', new StripTags()); $content = [ 'con"ntent' => 'value"', "ch'~ve" => "value'2", 'tag' => '<tag>content</tag>', ]; $this->instance->executeRules(['striptags', 'htmlentities', 'addslashes'], $content); // Print: // // Array( // 'con"ntent' => 'value"', // 'ch\\\'~ve' => 'value\\\'2', // 'tag' => 'content' // ) // echo $content;
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-08-14