<?php
include_once('./common.php');

echo "Countries variable exists: " . (isset($countries) ? 'YES' : 'NO') . "<br>";
echo "Countries count: " . (isset($countries) ? count($countries) : 0) . "<br>";
echo "Country_local_names exists: " . (isset($country_local_names) ? 'YES' : 'NO') . "<br>";
echo "Country_local_names count: " . (isset($country_local_names) ? count($country_local_names) : 0) . "<br><br>";

if (isset($countries)) {
    echo "First 5 countries:<br>";
    $i = 0;
    foreach ($countries as $country => $code) {
        if ($i++ >= 5) break;
        $display = $country;
        if (isset($country_local_names[$country])) {
            $display .= ' (' . $country_local_names[$country] . ')';
        }
        echo "$display ($code)<br>";
    }
}
?>
