Among $_REQUEST, $_GET and $_POST which one is the fastest?

后端 未结 15 2247
小鲜肉
小鲜肉 2020-11-22 05:04

Which of these code will be faster?

$temp = $_REQUEST[\'s\'];

or

if (isset($_GET[\'s\'])) {
  $temp = $_GET[\'s\'];
}
else          


        
15条回答
  •  逝去的感伤
    2020-11-22 05:28

    $_GET retrieves variables from the querystring, or your URL.>

    $_POST retrieves variables from a POST method, such as (generally) forms.

    $_REQUEST is a merging of $_GET and $_POST where $_POST overrides $_GET. Good to use $_REQUEST on self refrential forms for validations.

提交回复
热议问题