Re: [PHP] Function result is an array

2003-05-31 Thread Ernest E Vogelsinger
At 06:23 31.05.2003, Evan Nemerson said: [snip] >IMHO the function()[] syntax should be allowed, but it isn't. > >You could use list() or extract(), but then you'd wind up with a lot more >date >than you want. What I've been doing is creating a function, the

Re: [PHP] Function result is an array

2003-05-31 Thread Evan Nemerson
IMHO the function()[] syntax should be allowed, but it isn't. You could use list() or extract(), but then you'd wind up with a lot more date than you want. What I've been doing is creating a function, then calling when needed. For example: function array_get_value($array, $index) { retu

[PHP] Function result is an array

2003-05-31 Thread Dustin Mitchell
I briefly tried searching the archives for this, but there aren't any handy keywords, so I didn't find anything. Why can't I do this: $year = getdate($timestamp)['year']; (syntax error) while I can do this: $temp = getdate($timestamp); $year = $temp['year']; and is there a way to combine the a