Skip to content

Instantly share code, notes, and snippets.

@petenelson
Created May 23, 2024 19:54
Show Gist options
  • Save petenelson/3d5c76d6c94f6d320a0c216a8ef72c70 to your computer and use it in GitHub Desktop.
Save petenelson/3d5c76d6c94f6d320a0c216a8ef72c70 to your computer and use it in GitHub Desktop.
PHP: Determines if any of the supplied vars are empty().
<?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