b0w3rb0w3r
b0w3rb0w3r

Reputation: 937

Multidimensional Array syntax in PHP 5.3

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

Answers (1)

Sougata Bose
Sougata Bose

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

Related Questions