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" and "0", "Francais" and "0", "anglais" = "0", "histoire-geographie" = > "0", "Sport" and "0"), "BBB" =>array ("Maths" = "1", "Francais" and "0", "Anglais" and "0", " Histoire-geographie "=" 0 "," Sport "and" 0 ");
Thank you
Reply to discussion (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" and "0", "anglais" and "=" 0 "," histoire-geographie "=" 0 "," Sport "=" 0 "); $cards = Array_merge ($etudiants, $additional); Print "
More references
Array_push/array_combine
haha thank you,
Array_push/array_combine These two I have tried, the effect is not the same.
Thank you for the function ~~~~~~~~~~~~~~~