Re: Can PHP do an "IF" for 5-20

From: Date: Thu, 14 Dec 2000 17:20:33 +0000
Subject: Re: Can PHP do an "IF" for 5-20
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30322@lists.php.net to get a copy of this message
if ( ($number >= 5) && ($number <= 20) ) { blah; } Robert Abbate wrote: > > 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 > > > > http://www.InternetSubmit.net > Get Noticed! Submit your site to over 50,000 sites! > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- =========================================================================== Jim Jagielski [|] jim@jaguNET.com [|] http://www.jaguNET.com/ "Casanova will have many weapons; To beat him you will have to have more than forks and flatulence."

« previous php.general (#30322) next »