PHP地址栏输入也区分大小写吗,该如何处理

WBOY
Release: 2016-06-13 12:24:41
Original
1344 people have browsed it

PHP地址栏输入也区分大小写吗
aa.php文件如下:
        @$PID = 0;
@$PID = $_GET["ID"];
echo @$PID;
?>
如果在地址栏中输入的是aa.php?id=1,则取不到这个值,即输出为空,如果输入的是aa.php?ID=1,则可以取到这个值,输出1
这是怎么回事,地址栏也区分大小写吗?
------解决思路----------------------
php 的变量名(包括数组的关联键,类的属性名)是区分大小写的
------解决思路----------------------

引用:
如果是需要用户自己输入地址栏内容,那不可能规定用户必须输入小写或大写啊,在程序里怎么处理???

用函数strtolower或者strtoupper
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!