Re: PHP Brain Teasers
| From: | Colin Guthrie | Date: | Wed, 04 Jul 2007 15:20:36 +0000 |
| Subject: | Re: PHP Brain Teasers | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258249@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
> this one should be easy:
>
> function work($v) { echo "$v,"; }
> foreach(array_merge(range(9,12),range(1,5)) as $ing)
> work($ing);
>
<dolly>Workin' 9 til' 5</dolly>
On a similar theme:
function jack($all)
{
static int $play = 0;
if ($all == 'work' && !$play)
return 'dull boy!';
$play++;
}