D2.php

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <?php $landen = array( "Nederland" => "Amsterdam", "Frankrijk" => "Parijs", "Duitsland" => "Berlijn", "Spanje" => "Madrid" ); ksort($landen); foreach ($landen as $land => $hoofdstad) { echo "de hoofdstad van $land is $hoofdstad <br>"; } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse