Please explain the following code. I can't understand what is happening.
return !$test
It returns the opposite boolean value of $test
. If test is true, or anything that equates to true, it returns false. If it is false, or anything that equates to false, it returns true.
The "!" is the 'NOT' operator.
the "return !$test" check the variable is not true (false). If $test is false then return true.
Ex: !$a >>>> TRUE if $a is not TRUE.