How to check if php://input is set?

后端 未结 4 1866
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 10:54

I need to check if php://input exists/isset. Does it work with php isset() ? What is the proper way to check it?

4条回答
  •  盖世英雄少女心
    2021-02-19 11:25

    it returns true if variable exist and its not null

    $foo = 'bar';
    var_dump(isset($foo));        -> true
    
    $baz = null;
    var_dump(isset($baz));        -> false
    
    var_dump(isset($undefined));  -> false
    

提交回复
热议问题