Single isset() accepts multiple arguments

author
0 minutes, 16 seconds Read

PHP isset() accepts multiple arguments.
Generally, we use multiple isset() if there are multiple vars to be checked but we can use one isset() function to check all the vars at the same time,

// Do not do this
if (isset($var1) AND isset($var2) AND isset($var3))


// Do this instead
if (isset($var1, $var2, $var3))
PHP
Share To:

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *