I'm using querystring with $_REQUEST
array and each time I want to access an any key I use this condition
if(array_key_exists('scene_id', $_REQUEST))
Is there any way to directly use $_REQUEST["scene_id"]
without any warnings and errors?
I'm using querystring with $_REQUEST
array and each time I want to access an any key I use this condition
if(array_key_exists('scene_id', $_REQUEST))
Is there any way to directly use $_REQUEST["scene_id"]
without any warnings and errors?
You could wrap that in your own function ofcourse:
function request($key, $default=null) {
return isset($_REQUEST[$key])
? $_REQUEST[$key]
: $default;
}
echo request('scene_id');