Hi
I'm wondering what would be the best to use: "If"-statements or Associative Arrays. Let me give you an example:
$tralala = array(
"hopla" => array("a","b","c"),
"blahblah" => array("d","e","f"),
);
or
if($myvar == "hopla"){$the_array = array("a","b","c");}
if($myvar == "blahblah"){$the_array = array("d","e","f");}
The purpose is to pick just one keyword (hopla or blahblah) and then choose a random element from the array associated with it. The code I'm working on will likely have hundreds of these keywords, and I'm wondering if the "If-statement" approach might be faster (using a dbase like MySQL is sadly enough not an option). If not, would it improve if I used "elseif()" instead of "if()"?
Thanks!