Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199908

Re: [PHP3] switch From: Aaron Leon Kaplan (jjl <email protected>)
Date: 08/05/99

On Thu, 5 Aug 1999 halim <email protected> wrote:

> Hi,
>
> I have this one switch statement..
>
> say :
>
> switch ($table) {
> case '1' : statement;
> break;
> case '2' : statement;
> break;
> }
>
> now.. what i want is , if case '1' == case '2' ,
> how do i combine it so that both cases will execute the same statement?

In C you would do:
switch ($table) {
        case '1': stmt; // FALLTHRU!!!!
        case '2': stmt_for_both
          break;

Notice that there is no break in the first case.
I highly suspect that PHP has the same behaviour but I did not test it.

cheers,
Aaron.

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>