Re: multiple case-expressions for one case in switch ?

From: Date: Mon, 16 Oct 2000 15:57:29 +0000
Subject: Re: multiple case-expressions for one case in switch ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20382@lists.php.net to get a copy of this message
thanks. ----- Original Message ----- From: "Boget, Chris" <Chris.Boget@wild.net> To: "'Rebecca'" <rebecca@digitalpulp.com>; <php-general@lists.php.net> Sent: Monday, October 16, 2000 12:00 PM Subject: RE: [PHP] multiple case-expressions for one case in switch ? > > should this work? > > switch $variable > > { > > case "possiblity1", "possiblity2", "possiblity5": > > doThis($variable); > > break; > > case "possiblity3": > > doTheOther($variable); > > break; > > case "possiblity4": > > break; > > } > > No, what you want is this: > > switch( $variable ) { > case "one": > case "two": > case "five": > doThis(); > break; > > case "three": > doThat(); > break; > > case "four": > doTheOthers(); > break; > > } > > Chris > > -- > 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

« previous php.general (#20382) next »