Why is better to use filter_input()?

后端 未结 3 813
梦谈多话
梦谈多话 2020-12-16 11:46

This should be a elementary question but why is better to use something like this:

$pwd = filter_input(INPUT_POST, \'pwd\');

Instead of jus

3条回答
  •  被撕碎了的回忆
    2020-12-16 12:12

    It's not. $_GET, $_POST, $_COOKIE and $_REQUEST are filtered with default filter. filter_input(INPUT_POST, 'pwd') without additional parameters also uses the default filter. So there is no difference at all.

提交回复
热议问题