$locale = "en_US"; $primaryLanguage = Locale::getPrimaryLanguage($locale); echo "Primary language for $locale is $primaryLanguage"; //Output: Primary language for en_US is enThe package library for the Locale class in PHP is the Internationalization extension, also known as the intl extension. This extension provides a set of classes and functions that support internationalization and localization tasks, including the Locale class and its various methods. To use this class in your PHP project, you will need to have the intl extension installed and enabled.