“请不用直接访问超全局$_GET数组”

WBOY
Release: 2016-06-13 12:26:12
Original
796 people have browsed it

“请不要直接访问超全局$_GET数组”

下载了一个名为NetBeans的IDE开发PHP程序,当我输入常用的的$name = $_GET['name'];时却收到警告:请不要直接访问超全局$_GET数组 请改用某些过滤函数(例如filter_input() ,带有is_*()函数的条件等)。我这才明白其实我一贯的做法并不规范。实际上改成下面的形式就能够消除警告了:

<code>$name = "";if(is_string($_GET['name'])){	$name = strval($_GET['name']);}</code>
Copy after login

由于我使用的编程语言比较杂,所以有时候并不会去特意下载专门的IDE,windows一般就将就用秀丸、Editplus这种通用型的编辑器;而Mac则更懒直接用Xcode。不过现在觉得NetBeans真心不错呢,帮助我认识到了这个不规范的写法。看来以后应当遵循“工欲善其事,必先利其器”呵。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!