lundi 25 avril 2016

Pushing a key that points to another array PHP

I have tried the following:

$myArray = array();
array_push($myArray,"A"=>array("x","y"));

I get prompted with this error:

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW)

Is the above possible to do in php?

am I doing something wrong?

or is there a more conventional way of doing this?




Aucun commentaire:

Enregistrer un commentaire