php - check if $_POST is array?

前端 未结 8 660
独厮守ぢ
独厮守ぢ 2020-12-21 14:58

I know this may be a silly question, but I come across a snippet of php code that check if the $_POST is_array() before execute other functions.

8条回答
  •  暖寄归人
    2020-12-21 15:13

    That check is unnecessary. $_POST is a superglobal array which is always defined. You should just check for specific elements using isset

提交回复
热议问题