简介:<?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);
}
}
}这是一份很好用的PHP防注入类,需要的朋友可以下载使用
评论0
最新资源