May 14, 2014 · Public
I've seen a lot of PHP programmers use the following syntax for checking if multiple variables are set with the isset() function.
if( isset( $_POST["fname"] ) AND isset( $lname ) )
However, the isset() function can take multiple parameters and will only return TRUE if all are set and not equal to NULL. The above code could be simplified to:
if( isset( $_POST["fname"], $lname ) )
I hope that this helps someone out there!