$_REQUEST[$k] = isset($_GET[$k]) ? $_GET[$k] : $_POST[$k];
or
$_REQUEST[$k] = isset($_POST[$k]) ? $_POST[$k] : $_GET[$k];
Which is the case,reason?
$_REQUEST[$k] = isset($_GET[$k]) ? $_GET[$k] : $_POST[$k];
or
$_REQUEST[$k] = isset($_POST[$k]) ? $_POST[$k] : $_GET[$k];
Which is the case,reason?
$_REQUEST
is the union of $_GET
, $_POST
, and $_COOKIE
where variables_order and since PHP 5.3 request_order defines the order.
The default order is GET, POST, and then cookie. That means POST parameters overwrite existing GET parameters and cookies overwrite existing POST and GET parameters.
ini directive "variables_order" is believed* to affect $_REQUEST, see http://php.net/manual/en/ini.core.php
*"believed" because i never used either that or $_REQUEST itself.
$_REQUEST is simply the array that PHP puts all of the GET and POST and COOKIE parameters into, with precedence in that order in the case of conflicts.