When I'm validating form data, there are many occasions (more than
not) that I require most of them to be completed, and not left blank.
In which case you would do:
if(empty($_GET['var1'], $_GET['var2'], $_GET['var3'])){
     //Display error, yadda yadda
}
as aposed to
if(empty($_GET['var1']) || empty($_GET['var2']) || empty($_GET['var3'])){
     //Display error, yadda yadda
}
which is a much cleaner and simpler method. Doing it the other way (AND/OR)
 doesn't seem to have many applications that I can see.

On 4/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> The following is a direct excerpt from the PHP manual on empty, and isset:
> bool *empty* ( mixed var )
> bool *isset* ( mixed var [, mixed var [, ...]] )
> Is there a reason empty does not allow multiple variables at a time, as
> isset? Was there thought behind it, or is it just an inconsistency?
>



--
------------------------------------
Graham Christensen
www.itrebal.com
www.iamgraham.net

Reply via email to