Re: Re: PHP Brain Teasers
| From: | Tijnema | Date: | Thu, 12 Jul 2007 16:13:51 +0000 |
| Subject: | Re: Re: PHP Brain Teasers | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258721@lists.php.net to get a copy of this message | ||
On 7/12/07, Jon Anderson <jon@gamingsolutions.ca> wrote:
Daniel Brown wrote: Did you come before or after the chicken egg? Relevant to the above: $a = array('Chicken','Egg'); echo "The " . $a[array_rand($a)] . " comes first."; I appologize if this one's already been done...I've only glanced at a few entries in this thread, entertaining though it is. :-) jonThe same fault is made over and over again ;) as the fish egg was earlier (as noted here) Your code should be this: $a = array('Chicken','Chicken egg'); echo "The " . $a[array_rand($a)] . " comes first."; Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info