Why do I need the isset() function in php?

后端 未结 6 1698
终归单人心
终归单人心 2021-01-04 06:27

I am trying to understand the difference between this:

if (isset($_POST[\'Submit\'])) { 
  //do something
}

and

if ($_POST[         


        
6条回答
  •  盖世英雄少女心
    2021-01-04 07:22

    if user do not enter a value so $_post[] return NULL that we say in the description of isset:"

    isset will return TRUE if it exists and is not NULL otherwise it is FALSE.,but in here isset return the true "

提交回复
热议问题