Skip to content

Instantly share code, notes, and snippets.

@petenelson
Created May 23, 2024 19:54
Show Gist options
  • Select an option

  • Save petenelson/3d5c76d6c94f6d320a0c216a8ef72c70 to your computer and use it in GitHub Desktop.

Select an option

Save petenelson/3d5c76d6c94f6d320a0c216a8ef72c70 to your computer and use it in GitHub Desktop.

Revisions

  1. petenelson created this gist May 23, 2024.
    17 changes: 17 additions & 0 deletions any-empty.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?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;
    }