Home  >  Article  >  Backend Development  >  php?$_REQUEST

php?$_REQUEST

WBOY
WBOYOriginal
2016-06-20 12:52:001032browse

<?php$_GET['foo'] = 'a';$_POST['bar'] = 'b';var_dump($_GET);var_dump($_POST);echo "<br>";var_dump($_REQUEST); // 内容没有包含 'foo' or 'bar'?>

$_REQUEST ? HTTP Request 变量 说明 默认情况下包含了 $_GET,$_POST 和 $_COOKIE 的数组。
var_dump($_REQUEST); // 内容没有包含 'foo' or 'bar'?


回复讨论(解决方案)

$_REQUEST、$_GET、$_POST 保存的都是传入的数据
在代码中赋值的不算

 这个测试告诉我们request是php初始化的独立变量,并非实时从get或post变量读取

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