Re: to use switch or not to use switch

From: Date: Thu, 17 Oct 2002 01:07:52 +0000
Subject: Re: to use switch or not to use switch
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-120262@lists.php.net to get a copy of this message
sorry, strlen(), not sizeof(). -- Maxim Maletsky maxim@php.net On Thu, 17 Oct 2002 03:03:13 +0200 Maxim Maletsky <maxim@php.net> wrote: > > the answer can be as simple as: > > <? > $k = sizeof($field); > > if(...) > $file = 'this'; > elseif(...) > $file = 'that'; > > // etc ... > > include($file); > ?> > -- > Maxim Maletsky > maxim@php.net > > > On Wed, 16 Oct 2002 20:39:50 -0400 "John W. Holmes" <holmes072000@charter.net> wrote: > > > Sounds like a good time for a switch to me... > > > > ---John Holmes... > > > > > -----Original Message----- > > > From: Peter Houchin [mailto:php@vfsa.com.au] > > > Sent: Wednesday, October 16, 2002 8:19 PM > > > To: php_gen > > > Subject: [PHP] to use switch or not to use switch > > > > > > howdy > > > > > > am just courious to see what approach others would take given this > > > senario. > > > > > > I have a form which for the most part is basic to follow but I have > > one > > > field where people can enter any value up to 100k in now what has to > > > happen > > > is if they enter anything that equals 20k or lower is taken care of by > > one > > > script, if it is greater than 20k but less than or equal to 50k it is > > > handled by another script and if it is greater than 50k but equal to > > or > > > lower than 100k by another script and if it's greater than 100k > > another > > > script is run. > > > > > > if any one has any suggestions on different approaches to this i'd > > like to > > > hear it as I am looking for something relitively easy to code and and > > easy > > > for some one else to come in and change things if required down the > > track. > > > > > > Cheers > > > > > > Peter > > > "the only dumb question is the one that wasn't asked" > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#120262) next »