5

例如,在第 1 页我发送:

test.info :1;

然后在第2页:

echo $_REQUEST['test.info'];
echo $_REQUEST['test_info'];

第一个是 null ,第二个是 1 它更改为 test_info

我只是不知道 $key 改变的原因。

4

1 回答 1

20

它从 php 的旧时代开始,当 post、get 等变量变成了常规的全局变量。但是由于它们有不能包含点的限制,所以点变成了_

$test.info- 无效的变量名

$test_info- 有效的

于 2013-08-05T08:42:49.930 回答