Re: Re: PHP Brain Teasers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/12/07, Jon Anderson <jon@xxxxxxxxxxxxxxxxxx> 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. :-)

jon


The 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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux