Foreach in php arrays

<html lang="en">
<head>
    <title>Defining variables</title>
</head>
<body>
<?php
$countries=array("Kenya"=>"Nairobi", "Uganda"=>"Kampala", "Germany"=>"Berlin");
foreach($countries as $key=>$value){
    echo "The capital city of ". $key . " is " . $value;
    echo "<br>";
}
?>
</body>
</html>

It will produce this;

The capital city of Kenya is Nairobi
The capital city of Uganda is Kampala
The capital city of Germany is Berlin