RE: [PHP] switch statemnts.

From: Date: Fri, 14 Jul 2000 13:48:45 +0000
Subject: RE: [PHP] switch statemnts.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6635@lists.php.net to get a copy of this message
Cheers but I was trying to avoid (if then else), switch is much nicerer. :-) -----Original Message----- From: Teodor Cimpoesu [mailto:teo@digiro.net] Sent: 12 July 2000 17:59 To: php-general@lists.php.net Subject: Re: [PHP] switch statemnts. Hi Greg! On Wed, 12 Jul 2000, Greg Linnell wrote: > Can I do someting like this? > > switch($v){ > case <=0: > stuff; > case 0: > stuff; > case >=0: > stuff > default; > } kindof: if ($v <=0 ) { stuff; } else if ($v == 0) { stuff; } else { stuff; } > > and this > > switch($v){ > case 1 or 2 or 3 or 4: > stuff; > case 5,6,7,8: > stuff; > default; > } switch ($v) { case 1: case 2: /* so on */ stuff; break; default: stuff; break; } -- teodor -- 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 (#6635) next »