For a assignment I am asked to create an array of some users. (At least 5) I need to apply the For-Each structure but I don't understand what I'm doing wrong in my code since I only get the last value.
I hope someone can explain to me what I'm doing wrong and how I can solve this problem. My apologies in advance if I'm doing something wrong with the ToS...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>13-FOR-EACH controle structuren</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<?php
$user = array(
"Gebruikersnaam" => "OJ", "Wachtwoord" => "Aapje@123", "Email" => "info@officialjens.be",
"Gebruikersnaam" => "Wolf", "Wachtwoord" => "Wolfje@123", "Email" => "wolf@wolftm.nl",
"Gebruikersnaam" => "PietjePuk", "Wachtwoord" => "Pukje@123", "Email" => "help@pietpjepuk.eu",
"Gebruikersnaam" => "Aquila", "Wachtwoord" => "Aquila@123", "Email" => "info@aquila.org",
"Gebruikersnaam" => "CS", "Wachtwoord" => "CS@123", "Email" => "info@creationlystudio.com");
print "<ol>";
foreach ($user as $key => $value) {
print "<li>$key : $value</li>";
}
print "</ol>";
?>
</body>
</html>
What is expected in this assignment is that it print all 5 users.