<?php /** * 参数处理类 * @author JasonWei */ class Params { public $get = array(); public $post = array(); function __construct() { if (!emptyempty($_GET)) { foreach ($_GET as $key => $val) { if (is_numeric($val)) { $this->get[$key] = $this->getInt($val); } else { $this->get[$key] = $this->getStr($val); } } } if (!emptyempty($_POST)) { foreach ($_POST as $key => $val) { if (is_numeric($val)) { $this->post[$key] = $this->getInt($val); } else { $this->post[$key] = $this->getStr($val); } } }
This is a very useful PHP anti-injection class. Friends who need it can download and use it
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
15 Jul 2016
20 extremely useful PHP libraries. Below are some very useful PHP libraries, which I believe can provide a better and faster method for your WEB development. Chart libraries The following libraries allow you to easily create complex charts.
10 Apr 2018
The content of this article is to recommend 25 very useful class libraries in PHP. It has certain reference value. Friends in need can refer to it.
06 Jul 2016
What are some very useful class libraries or tool libraries for PHP?
13 Jul 2016
Recommend 25 very useful class libraries in PHP and 25 non-Chinese class libraries in PHP. Recommended 25 very useful class libraries in php, 25 non-class libraries in php Snappy Snappy is PHP5 used to generate thumbnails, snapshots, PDF, URL or HTML pages. It uses the excellent WebKit-based wkht
25 Jul 2016
PHP anti-sql injection class (php pdo prevents sql injection class)
11 Nov 2016
<?php class Model{ protected $tableName="";//表名称 protected $pOb;//pdo类对象 function __construct(){ $pdo=new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USERNAME, ...
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images