Home >php教程 >php手册 >I方法小技巧

I方法小技巧

WBOY
WBOYOriginal
2016-06-07 11:41:341053browse

I方法用法,可以使用I('')代替$_POST,或者$_GET,比较安全
 // I()方法使用默认的过滤函数进行过滤,然后添加到数据库<br> //在处理数组类的场景,不太适合,例如:$_POST['id']是批量获取值,这里应该注意<br> <br>         if(M('Node')->add(I(''))){   <br>             $this->success('保存成功',U('Admin/Rbac/node'));<br>         }else{<br>             $this->error('保存失败');<br>         }

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn