PHP Code:
if (isset($_POST['submit'])) {
//Country is defined from a form (notice the orginal $_POST[])
$country = $_POST['country'];
//array is being created.
$capital=array(
//goes "Country => "Capital" seperated by commas
"England" => "London",
"France" => "Paris"
);
//string replaced is used so the country that's chosen selects from the array where it is the same. Then becomes $capital variable
$capital = str_replace(array_keys($capital), array_values($capital),$country);
echo $capital;
} else {
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
echo '<select name="country">';
echo '<option>England</option>';
echo '<option>France</option>';
echo '</select>';
echo '<input type="submit" name="submit" value="go!">';
echo '</form>';
}