In message <[EMAIL PROTECTED]>, whoisquilty
<[EMAIL PROTECTED]> writes
>I'm trying to set a variable for a series of "if" statements.
>
>if('PB'==$pg)
>{
>print '1';
>}
>if('B1'==$pg)
>{
>print '2';
>}
>
>And, I'd like the default to print 3 (in other words, not having set $pg to 
>anything).
>
>However, if someone hits the page without $pg having a value, what do I do? In 
>normal 
>circumstances, I'd use an if/else statement. But I don't see how to do that 
>with 
>multiple if's.
>
>Jeremy

What about 
switch ($pg){
case 'PB': print 1;break;
case 'B1':...
default: print something else
}

-- 
Pete Clark

Sunny Andalucia
http://www.hotcosta.com/comm_1.htm


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-list/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to