note 97799 deleted from language.operators.comparison by crell

From: Date: Wed, 30 Mar 2022 21:49:04 +0000
Subject: note 97799 deleted from language.operators.comparison by crell
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-217792@lists.php.net to get a copy of this message
Note Submitter: alan dot g at nospam dot net ---- a function to help settings default values, it returns its own first non-empty argument : make your own eor combos ! <?php /* * Either Or * * usage: $foo = eor(test1(),test2(),"default"); * usage: $foo = eor($_GET['foo'], foogen(), $foo, "bar"); */ function eor() { $vars = func_get_args(); while (!empty($vars) && empty($defval)) $defval = array_shift($vars); return $defval; } ?>

« previous php.notes (#217792) next »