$listfile = file("list.txt");
foreach ($listfile as $k => $v) {
$country = explode("\t", trim($v));
$list[$country[0]] = $country[1];
$countrylist[] = $country[0];
}
$country = array();
foreach ($countrylist as $country) {
if (isset($_REQUEST[str_replace(" ", "_", $country)]))
$know[] = $country;
else
$dontknow[] = $country;
}
if (count($know) > 0) {
if (count($know) > 0) {
echo "You know: ".count($know)."
\n";
foreach ($know as $k => $country) {
if ($k == (count($know) - 1))
echo "$country.
\n";
else
echo "$country, ";
}
}
if (count($dontknow)) {
echo "You don't know: ".count($dontknow)."
\n";
foreach ($dontknow as $k => $country) {
if ($k == (count($dontknow) - 1))
echo "$country.
\n";
else
echo "$country, ";
}
}
echo "";
}
else {
echo "