Re: Switch case syntax
| From: | David Robley | Date: | Tue, 21 Aug 2001 05:20:39 +0000 |
| Subject: | Re: Switch case syntax | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63622@lists.php.net to get a copy of this message | ||
On Tue, 21 Aug 2001 14:22, -:-Doigy-:- wrote:
> Hi Folks,
>
> In a switch, I have a load of 3 letter prefixes I'm sorting by. They
> are the truncated first 3 letters of alpha-numeric product codes which
> gives the category of the product.
> Some codes start with MB- for instance, and this causes a parsing
> error. Can I fix this without changing the fact I'm switching on a 3
> letter string?
>
> Cheers
You are sticking those values in quotes? Frinstance
switch($variable) {
case 'IBM':
break;
case 'DEC':
break;
case 'MB-':
break;
}
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
If I knew what I was doing...I'd be dangerous...