Created
May 23, 2024 19:54
-
-
Save petenelson/3d5c76d6c94f6d320a0c216a8ef72c70 to your computer and use it in GitHub Desktop.
PHP: Determines if any of the supplied vars are empty().
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Determines if any of the supplied vars are empty(). | |
* | |
* @param arra ...$vars List of vars. | |
* @return bool | |
*/ | |
function any_empty( ...$vars ) { | |
foreach ( $vars as $var ) { | |
if ( empty( $var ) ) { | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment