como/input 问题修复 & 功能扩展

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

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

como/input

Composer 安装命令:

composer require como/input

包简介

A Input class for that makes it easier for accessing user input

关键字:

README 文档

README

This is a library that makes it easier to safely retrieve user input. The class provides an abstraction to the superglobals $_GET and $_POST arrays. It is typically unsafe to operate directly on those arrays as it is easy to forget to do the validation neccessary to prevent unexpected behavior.

For example if your url is a GET request like this: example.com/index.php?id[]=111, then you would normally access that value from the 'id' subscript of the $_POST array. However, if your application then proceeds to try and pass that value to a method that requires a string type value, you will have trouble because $_POST['id'] is in fact an array and not a string.

The Input class handles these things automatically for you by peforming these checks. It also sanitzes all values subsequently making an input value safe for output on the client such as a web browser.

To Use

require DIR . '/vendor/autoload.php';

use \Como\Http\Input;

// this will return the default value if the q request is an array var_dump(Input::get('q', Input::FILTER_ARRAY, $default = 'default value'));

// this will allow an array var_dump(Input::get('q', Input::NO_FILTER_ARRAY, $default = 'default value'));

To install via composer:

create a composer.json file with this:

{ "require": { "como/input": "dev-master" } }

then run composer install in the directory of your choice

To install from GitHub

git clone http://github.com/rmccullagh/como-http.git

Then open up the test.php file and take a look at the examples.

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2014-02-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固