Reputation: 937
Is the following code valid for assigning keys and data into a multi-dimensional array in PHP 5.3 and if not what's the alternetive? I know it works in 5.4 not sure about 5.3.
$agent_array = $agent_name= []
$agent_array [$agent_name[0]][] = $agent_name[0]
Upvotes: 0
Views: 399
Reputation: 31749
5.3
doesnot support shorthand array syntax. You need to use array()
. The code will be -
$agent_array = $agent_name= array();
The rest should work.
Upvotes: 1