Hello Jim,

I heard of arrays in the following context:
if (($foo==5) || ($foo=="orange") || ($foo==88) ......
So *that* would be done much better and cleaner with arrays.
$FoosArray=array(5, "orange", 88);
if (in_array($foo, $FoosArray)) { ... }

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Jim Giner <jim.gi...@albanyhandball.com>
To: php-general@lists.php.net
Date created: , 12:36:26 AM
Subject: [PHP] Re: What's faster using if else or arrays?


      how many entries are you talking about, ie., how many conditions?  
Obviously 
if you have more than 4-5 it's going to be easier to code up as a case 
statement (?) rather than an if/else.

Never in all my days have I ever heard of using an array for such a 
determination though.

(remainder deleted for all reader's sakes :) ) 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to