Are there php file with array with countries and cities, something like that:
$country[] = "Albania";
$country[] = "Algeria";
And the same with cities? Or are there any other, maybe better, solutions for showing countries for users and give them to select? Thanks.
Yes, GeoNames:
$countries = json_decode(file_get_contents('http://www.geonames.org/countryInfoJSON'), true);
For cities you need to use the bounding box coordinates (available from the previous request result) and the Cities method, localization is also supported for most languages using the lang query string.
EDIT: You probably want to cache (or download) these results to avoid overloading GeoNames server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With