Often I just want to be able to get at a single element from a
function that returns an array. For example, if I just want the
current year I need to write:
$today = getdate();
$year = $today['year'];
Call me lazy but this is two steps to return a single value.
In perl I can nest these two step together into something like:
$year = ( $getdate() )['year'];
I've tried to get several variations of this to work in php but I
don't seem to be having any luck.
Is this style possible in php?
Thanks,
crub