I am using PHP 5.4.18 and am trying to use the Locale object.
I have tried the following calls:
$locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
I get the errors 'Call to undefined function' and 'Class Locale not fund', respectively.
I found a mention somewhere that the php_intl extension needs to be enabled. I did this.
I've also looked at the Locale Manual(http://www.php.net/manual/en/class.locale.php), but there is not mention of needing to enable anything.
What preparation do I need to undergo to enable the Locale class?
Okie. I found that the php_intl file is not loading. However, it is present in the php/ext directory and the path it shows in the error log is correct.
As a note: I am using WAMP.
A "Locale" is an identifier used to get language, culture, or regionally-specific behavior from an API. PHP locales are organized and identified the same way that the CLDR locales used by ICU (and many vendors of Unix-like operating systems, the Mac, Java, and so forth) use.
Edit: The original list of locales has been edited to add additional locales that were not included before. Now 228 listed. The most important thing for various versions of English is in formatting numbers and dates.
On Ubuntu Linux:
sudo apt-get install php5-intl
service apache2 restart
Solution for XAMPP
Uncomment (remove ; at the beginning) this line in php.ini
extension=intl
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