This sounds really dumb but I can't get my head around !isset(). Can anyone help by explaining it, in simple language?

    isset() checks to see if your variable is set... (makes sure that its not null)

    !isset() would be in a statement like

    if (!isset($Var)) The "!" checks to see the opposite, so its checking if it isn't set!

      The function name isn't too helpful and may throw you off when you first see it.

      I know the feeling.. you ask yourself "WTF does it mean to be set, and not set?"

      Then you get the answer:
      "Set means non-null. Not set means null."

      Go with the flow and don't fight it. Resistance is futile! 😃

        Maybe instead of using !isset(), try using the empty function. Keep in mind that the isset function checks to see if the variable is set, when empty() checks to see if the variable is a non-zero.

          I dont think its a matter of him using another function. He is asking "WTF does isset() do?" or "WTF does it mean to be "set" and "not set"?

          In regards to empty():
          You got to be careful when using empty(). It ALSO checks if the value is an integer 0 or a string "0". Read the docs.

          Example:

          formValidation.php

          // if temperature was 0, this would be a bad thing.

          if (empty($_POST['temperature'])
          return(INCORRECT_VALUE);

            Write a Reply...