I would be grateful for some help with this code.
The comments in the code show what I'm expecting as output, but
instead I'm getting "undefined variable peru" and "undefined variable
japan"...
<?
$peru = array("domain"=>"pe", "capital"=>"Lima");
$japan = array("domain"=>"jp", "capital"=>"Tokyo");
function show ( $country ) {
print "Internet domain = ".${$country}["domain"]."\n";
print "Capital city = ".${$country}["capital"]."\n";
}
show ("peru");
// Prints:
// Internet domain = pe
// Capital city = Lima
show ("japan");
// Prints:
// Internet domain = jp
// Capital city = Tokyo
?>
I'm new to PHP- as you can tell!
Thanks in advance.