RE: [PHP] Can PHP do an "IF" for 5-20

From: Date: Fri, 15 Dec 2000 00:08:57 +0000
Subject: RE: [PHP] Can PHP do an "IF" for 5-20
Groups: php.general 
Request: Send a blank email to php-general+get-30412@lists.php.net to get a copy of this message
if ($number >= 4 && $number <= 20) { DO SOMETHING } or to do it dynamically $min = 4; $max = 20; if ($number >= $min && $number <= $max) { DO SOMETHING } Cheers, mark -----Original Message----- From: Robert Abbate [mailto:cogea@ectisp.net] Sent: Friday, 15 December 2000 4:18 AM To: php-general@lists.php.net Subject: [PHP] Can PHP do an "IF" for 5-20 Is there a way to do an "if" statement to include a series of numbers instead of matching just ONE? I know that you can use the "switch" operator, but I have a great multitude of numbers. Is "switch" the only answer? Example: if ($number == '5 through 20') { do something } Thanks -- Robert

« previous php.general (#30412) next »