(sketchie) Could you not just use for(each) and an if statement to check? rather then all that code you've put there?
PHP Code:
<?php
$country = $_POST['country'];
$capital=array(
"UK" => "London",
"France" => "Paris",
"Germany" => "Berlin",
"Spain" => "Madrid"
"Etc" => "Etc"
);
foreach ($capital as $k => $v)
{
if($country == $k)
{
echo "The Capital of ".$k." is ".$v;
}
}
?>
For Muhammad: This basically cycles through each of the countries finds a match and the echos the capital.
P.S. (sketchie) You don't know your countries and capitals
London is the capital of the UK