Re: Multiple "if()" statements
| From: | John Meyer | Date: | Fri, 30 Jun 2006 05:07:15 +0000 |
| Subject: | Re: Multiple "if()" statements | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238953@lists.php.net to get a copy of this message | ||
Larry Garfield wrote:
switch is fine if your elseif comparisons are equality based. If they're not equality based, then they don't map to switch as well.In other words, if you look at a logical ladder as the roots of the tree, as long as each root has the same number of forks (say each fork ends only one way), your fine with a switch. If you have one, however, that has only one condition, and another that has two, then you need an if...elseif logic tree. -- Online library -- http://pueblonative.110mb.com 138 books and counting.