PHP two-dimensional array append assignment problem ~~~~~~~~~
I have an array of student names and grades
$etudiants =array ("AAA" =>array ("Maths" and "0", "Francais" and "0", "anglais" = "0", "histoire-geographie" = > "0", "Sport" = "0")
);
Now I want to append an assignment to the back.
"BBB" =>array ("Maths" = "1", "Francais" and "0", "anglais" = "0", "Histoire-geographie" and "0", "Sport" = > "0")
Become
$etudiants =array (
"AAA" =>array ("Maths" = "0", "Francais" and "0", "anglais" = "0", "Histoire-geographie" and "0", "Sport" = > "0"),
"BBB" =>array ("Maths" = "1", "Francais" and "0", "anglais" = "0", "Histoire-geographie" and "0", "Sport" = > "0")
);
Thank you
------Solution--------------------
$etudiants ["BBB"] = Array ("Maths" = "1", "francais" = "0", "anglais" = "0", "Histoire-geographie" and "0", " Sport "=" 0 ");
Or
$etudiants = Array ("AAA" =>array ("Maths" = "0", "francais" = "0", "anglais" = "0", "histoire-geographie" = > "0", "Sport" = "0");
$additional = Array ("BBB" =>array ("Maths" = "1", "francais" = "0", "anglais" = "0", "histoire-geographie" = > "0", "Sport" = "0");
$cards = Array_merge ($etudiants, $additional);
Print "";
More references
Array_push/array_combine