PHP POST array with empty and isset

后端 未结 3 1246
灰色年华
灰色年华 2021-01-15 11:26

I have the following multiple checkbox selection:

Apple


        
3条回答
  •  温柔的废话
    2021-01-15 11:33

    Answer:

    1. $_POST array does not contain $_POST['fruit_list']
    2. First answer is "No".A variable is considered empty if it does not exist or if its value equals FALSE. empty() does not generate a warning if the variable does not exist.see in php.net
    3. Empty checks if the variable is set and if it is it checks it for null, "", 0, etc. Isset just checks if is it set, it could be anything not null. see

提交回复
热议问题