Possible Duplicate:
Interpreting return value of function directly as an array
Is there a way I can use the following?
$year = getdate()["year"]; ??
If my function returns an array, can I read the value without writing another line?
Thank you for your help!
Yes you can do that without writing newline…
Since PHP 5.4 it is possible to do so:
It is called array dereferencing.