Re: If statement w/ multiple conditions

From: Date: Tue, 26 Nov 2002 14:23:45 +0000
Subject: Re: If statement w/ multiple conditions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126089@lists.php.net to get a copy of this message
Something like this will work... <?php if(empty($_GET['1']) && empty($_GET['2']) && empty($_GET['3']) && empty($_GET['4'])){ echo "All vars are EMPTY"; }else{ echo "Some vars contain Content"; } ?> <ed@home.homes2see.com> wrote in message news:Pine.LNX.4.04.10211260745120.8696-100000@home.homes2see.com... > > I'll be trying to use a routine that checks 4 seperate variables for > content and need to know the easiest method to do so. The function works > on 2 conditions; either all the variables are empty and I do something or > I do something else. > > $lineone > $linetwo > $linethree > $linefour > > Would you use > > if ($lineone && $linetwo && $linethree && $linefour = "") > > Thanks, > > Ed > >

« previous php.general (#126089) next »