Country code lookup
ISO 3166-1 alpha-2 two-letter codes, case-insensitive, with an exception on invalid input.
ISO 3166 / PHP
Hemisphere, flag emoji and BCP 47 names in one lookup, with six framework adapters.
season resolves the current season from an ISO 3166-1 alpha-2 country code. The southern hemisphere table is built in, and trans-equatorial countries follow the hemisphere where most of their population lives.
The same entry point also returns Chinese season names, flag emoji, season emoji and BCP 47 localized names. Everything is an in-memory lookup with no IO and no state changes.
A round globe spirit: spring green in the upper left hemisphere, autumn orange in the lower right, a sprout on top and four seasonal emblems around it.
Same month, two seasons.Country code and date in, season and text out.
ISO 3166-1 alpha-2 two-letter codes, case-insensitive, with an exception on invalid input.
A built-in southern hemisphere table, with trans-equatorial countries decided by population majority.
Blossom, sun, leaf and snowflake graphics, returned for the country's current season.
BCP 47 locale resolution supporting forms such as zh_CN, en_US and de_DE.
Regional indicators generated from the two-letter code, for upper or lower case input.
Laravel, ThinkPHP, Hyperf, Yii2, Yii3 and webman are all supported.
Every version maps to a real commit and release.
Added the native PHP bootstrap and Mascot/Emoji APIs, and fixed trans-equatorial country detection.
Removed KI and UM, which are mostly in the northern hemisphere, added TL and AS, and added regression tests.
Fixed PHPStan always-true assertion errors and added unit tests and reports for every module.
Completed the hemisphere data fix and documented known issues and release notes.
Click an image to enlarge.
Install it, then look up a season by country code.
composer require erikwang2013/seasonuse Erikwang2013\Season\CountrySeason;
$season = CountrySeason::getSeason('CN');
$zh = CountrySeason::getSeasonNameZh('AU');
$flag = CountrySeason::getCountryFlagEmoji('JP');
$name = CountrySeason::getSeasonNameLocalized('DE', 'de_DE');Hover and the mood changes.