$ _POST区分大小写 [英] $_POST case sensitivity

查看:134
本文介绍了$ _POST区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不认为自己是PHP的新手,因为我从来没有在其中写过一行代码(我自己是一个perl人),但是我是团队的一部分。 />
使用的是将一些php接口写入数据库并且我注意到他们正在转发HTML表单值名称,因为他们总是将
小写代码(即$ _POST [''save''](fyi可能输入

错误))根据我的经验,它总是更好,当阅读

时发布信息以将表单值名称转换为大写

,因为一个网页可能具有NAME =" save"和另一个

可能有NAME =保存,这样你就可以随时获得价值。


在perl这很容易因为你拉在名称/值对中

直接来自ENV值。但是,从我所看到的,他们说,

PHP为你做这个并把它放到$ _POST,有没有办法告诉

PHP总是转换为这个值的名称是大写的?


Bill H

I wouldn''t consider myself a newbie to PHP since I have never written
one line of code in it (am a perl guy myself), but part of a team I am
working with is writing some php interfaces into a database and I
noticed that they are relaying on HTML form value names to always be
lowercase in their code (ie $_POST[''save''] (fyi that may be typed
wrong)) and from my experience it is always better, when reading in
the post information to convert the the form value name to uppercase
on the off chance that one web page may have NAME="save" and another
may have NAME="Save", this way you can will always get the value.

In perl this is easy cause you are pulling in the name / value pairs
straight from the ENV value. But since, from what I see and they say,
PHP does this for you and puts it into $_POST, is there a way to tell
PHP to always convert the name of the value to uppercase?

Bill H

推荐答案

_POST [''save''] (可能是打字的错误

错误))从我的经验来看,总是更好,当读取

的帖子信息将表格值名称转换为大写<一个网页可能有NAME =" save"的概率为
和另一个

可能有NAME =保存,这样你就可以随时获得价值。


在perl这很容易因为你拉在名称/值对中

直接来自ENV值。但是,从我看到的,他们说,

PHP为你做这个并把它放进
_POST[''save''] (fyi that may be typed
wrong)) and from my experience it is always better, when reading in
the post information to convert the the form value name to uppercase
on the off chance that one web page may have NAME="save" and another
may have NAME="Save", this way you can will always get the value.

In perl this is easy cause you are pulling in the name / value pairs
straight from the ENV value. But since, from what I see and they say,
PHP does this for you and puts it into


_POST,有没有办法告诉

PHP总是将值的名称转换为大写?

Bill H
_POST, is there a way to tell
PHP to always convert the name of the value to uppercase?

Bill H


Bill H写道:
Bill H wrote:

>我不认为自己是PHP的新手,因为我从未写过

一行代码(上午)我自己的perl家伙),但是我和一个团队的一部分工作是将一些php接口写入一个数据库,我发现他们正在转发HTML表单值名称总是在代码中小写
小写(即
>I wouldn''t consider myself a newbie to PHP since I have never written
one line of code in it (am a perl guy myself), but part of a team I am
working with is writing some php interfaces into a database and I
noticed that they are relaying on HTML form value names to always be
lowercase in their code (ie


这篇关于$ _POST区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆