Re: Multiple "if()" statements
| From: | tedd | Date: | Fri, 30 Jun 2006 12:37:29 +0000 |
| Subject: | Re: Multiple "if()" statements | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238977@lists.php.net to get a copy of this message | ||
At 11:07 PM -0600 6/29/06, John Meyer wrote:
>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.
Interesting -- can you give me an example?
Perhaps I'm showing my ignorance, but I never ran into an elseif problem that I couldn't
better solve (for me) with a switch. I've never *had* to use one.
tedd
--
------------------------------------------------------------------------------------
http://sperling.com http://ancientstones.com http://earthstones.com