NYCPHP Meetup

NYPHP.org

[nycphp-talk] $$ question

Rolan Yang rolan at omnistep.com
Thu May 26 10:29:06 EDT 2005


Dan Cech wrote:

> David Mintz wrote:
>
>> On Thu, 26 May 2005, Rolan Yang wrote:
>>
>>> I'd have to agre with Andrew's solution mentioned above.
>>> Looks like your simple script could even do without a function block.
>>> Here's a more concise way of doing it:
>>
>>
>> <snip snip snip />
>>
>>> <?     while(list($trash,$event)=each($data)) {
>>
>>
>>
>> or for even less typing:
>>
>>     while(list(,$event) = each($data)) {
>>
>
> or even
>         foreach ($data as $event) {
>
> ... which has the advantage of running faster too
>
There is so much valuable knowledge (and entertainment) to be gained by 
watching a mob of developers optimize code. If this were all compiled 
into a book or wiki, I would read it all day long.

~Rolan




More information about the talk mailing list