$countries = new \League\ISO3166\ISO3166; foreach ($countries->all() as $country) { echo $country['name'] . ' (' . $country['alpha2'] . ')' . PHP_EOL; }
$countries = new \League\ISO3166\ISO3166; $country = $countries->alpha2('US'); echo $country['name'] . ' has a population of ' . $country['population'] . ' and uses the ' . $country['currency'] . ' currency.' . PHP_EOL;Overall, the Countries library is a great resource for PHP developers who need to work with country data.