Do you know if it's better to use PHP array() or []
I know that [] is the short version of array() but I can not know the PHP recommendations ?
What is the best way to do following PHP ?
Thank you !
Do you know if it's better to use PHP array() or []
I know that [] is the short version of array() but I can not know the PHP recommendations ?
What is the best way to do following PHP ?
Thank you !
both are same the only difference is [ ] is supported in PHP >= 5.4:
['id' => 'id', 'name' => 'name']
This is a short syntax only and in PHP < 5.4 it won't work.