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

后端 未结 4 1868
伪装坚强ぢ
伪装坚强ぢ 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:30

    Suppose you are getting user input from a POST request you can check if it's a set like this

     if(isset($_POST['var_name']))
     {
          //for additional checking  like if  it's not  empty do this
          if(!empty($_POST['var_name']))
          {
               //Do whatever you want here
          }
     }
    

提交回复
热议问题