Reply to Re: Can I get the value from an assoc array that is returned by a function...in one statement?
Posted by NC on 01/12/06 02:53
lwoods wrote:
>
> I want to be able to get the present year in one statement. I know that I
> can do it this way:
>
> $y = getdate();
> echo 'year='.$y['year'];
>
> But, I want to do something like:
>
> echo 'year='.getdate()['year']; # BAD, I know
There's no need to use getdate() if all you want is year. Consider
this: