use CountryWhere\CountryWhere; $countryWhere = new CountryWhere(); $country = $countryWhere->findCountryByCode('US'); echo $country->getName(); // United States echo $country->getCapital(); // Washington D.C.
use CountryWhere\CountryWhere; $countryWhere = new CountryWhere(); $country = $countryWhere->findCountryByIp('8.8.8.8'); echo $country->getName(); // United States echo $country->getCapital(); // Washington D.C.With Country where, you can also retrieve information about the currency, population, continent, language, and region of a country. The package library can be installed via Composer dependency manager.