RE: [PHP-DB] How do I add multiple var to a if clause ?

From: Date: Thu, 21 Feb 2002 10:46:32 +0000
Subject: RE: [PHP-DB] How do I add multiple var to a if clause ?
Groups: php.db 
Request: Send a blank email to php-db+get-17119@lists.php.net to get a copy of this message
either.... if (($var <= 3)&&($var >= 1)){ } if you want it to just be somewhere between one and 3, or.... $my_array = array ("1", "2", "3"); if (in_array($variable, $my_array)) { } if you want it to be just one of those exact values. -----Original Message----- From: Dave Carrera [mailto:dave@davecarrera.com] Sent: 21 February 2002 10:40 To: php List Subject: [PHP-DB] How do I add multiple var to a if clause ? Hi All If($var == 1,2,3){ } This is wrong so what is the right way. I am try to find out a if var equals either 1 2 or 3 do something type thing but cant find answers anywhere Thanks in Advance Dave Carrera Php / MySql Development Web Design Site Marketing http://www.davecarrera.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02

« previous php.db (#17119) next »