intl

How to solve the issue - please install the “intl” extension for full localization capabilities

巧了我就是萌 提交于 2019-11-29 09:27:24
What i Need I'm implementing currency symbol using symfony. I have referred this link : http://symfony.com/doc/current/components/intl.html . The code i have implemented: use Symfony\Component\Intl\Intl; \Locale::setDefault('en'); $currencies = Intl::getCurrencyBundle()->getCurrencyNames(); $currency = Intl::getCurrencyBundle()->getCurrencyName('INR'); $symbol = Intl::getCurrencyBundle()->getCurrencySymbol('INR'); $fractionDigits = Intl::getCurrencyBundle()->getFractionDigits('INR'); $roundingIncrement = Intl::getCurrencyBundle()->getRoundingIncrement('INR'); Error: The Symfony\Component\Intl

How to get the default currency from the PHP Intl ( ICU library )

左心房为你撑大大i 提交于 2019-11-29 04:54:56
I use PHP, and like to know how I can get the default currency for a locale via the Internationalization extension (Wrapper for the ICU library)? Below is a script that explains, what and why. I need something to replace the getCurrCode() function with. $accepted_currencies = array('USD','EUR'); $locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); if( ! empty($locale)){ Locale::setDefault($locale); $currency = getCurrCode(); if( ! in_array($currency, $accepted_currencies)){ $currency = 'USD'; } }else{ Locale::setDefault('en_US'); } $fmt = new NumberFormatter( $locale,

List of available collators in PHP?

元气小坏坏 提交于 2019-11-28 10:10:42
I am considering using collators in PHP (I am no expert in PHP). Is there a way to know/list all collators available in PHP? I am looking for something similar to Java's Collator.getAvailableLocales() . Thanks. I think the Collator is using the locale information from the CLDR repository. I compiled a list from it's current trunk : af af_NA af_ZA ar ar_001 ar_AE ar_BH ar_DZ ar_EG ar_IQ ar_JO ar_KW ar_LB ar_LY ar_MA ar_OM ar_QA ar_SA ar_SD ar_SY ar_TN ar_YE as as_IN az az_Latn az_Latn_AZ be be_BY bg bg_BG bn bn_BD bn_IN bs bs_BA ca ca_ES chr chr_US cs cs_CZ cy cy_GB da da_DK de de_AT de_BE de

Why can't PHP on Windows see extension php_intl.dll even though it exists?

£可爱£侵袭症+ 提交于 2019-11-28 10:06:43
I've been trying to get the intl extension working on my test workstation (PHP 5.5.1, Apache 2.2.4, Windows 7 32-bit). It seems that no matter what I try I can't get it up and running. I've uncommented the line "extension=php_intl.dll" in my php.ini. I've verified the extension_dir directive is pointing at the correct directory (c:\wamp\php5.5\ext). I've verified php_intl.dll is in c:\wamp\php5.5\ext. I've verified that all the icu*.dll files are present in the php root directory (c:\wamp\php5.5). I've verified that c:\wamp\php5.5 is in my PATH. And yes, the copy of php.ini I'm editing is the

Install intl PHP extension OSX High Sierra

本小妞迷上赌 提交于 2019-11-28 05:26:10
How can I install intl PHP extension in PHP 7.1.7, which is delivered with osx high sierra? So I had the exact same issue. As noted by other folks commenting here, High Sierra comes with PHP 7.1 installed and this PHP version has intl compiled with it In my case, I followed part of Neodork comment's in the following Valet+ issue : "Install" PHP 7.1 (so it comes from brew itself, not the one installed by High Sierra) brew install php@7.1 Upgrade it to latest version brew upgrade php@7.1 Symlinks for references in Cellar: brew link --overwrite --force php@7.1 Change PHP path in my bash profile

PHP Warning: Module already loaded in Unknown on line 0

﹥>﹥吖頭↗ 提交于 2019-11-27 13:51:24
On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying) PHP Warning: Module 'intl' already loaded in Unknown on line 0 I ran php --ini and the output was php --ini PHP Warning: Module 'intl' already loaded in Unknown on line 0 Warning: Module 'intl' already loaded in Unknown on line 0 Configuration File (php.ini) Path: /usr/local/etc/php/5.5 Loaded Configuration File: /usr/local/etc/php/5.5/php.ini Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d Additional .ini files parsed: /usr/local

How to install the Intl extension for Twig

扶醉桌前 提交于 2019-11-27 07:06:47
The Intl extension is an extension for Twig that adds the localizeddate , localizednumber and localizedcurrency filters. How can I install and set up the extension so that I can use those filters in my Twig templates? Install the PHP intl extension First of all, you will need the PHP intl extension , as the Twig extension is built on top of that. The Twig Intl extension will throw an Exception if the PHP intl extension is not enabled. Installation instructions can be found in the official PHP documentation. On Ubuntu/Debian machines, this is as easy as running the following command: sudo apt

Why can't PHP on Windows see extension php_intl.dll even though it exists?

南楼画角 提交于 2019-11-27 03:26:25
问题 I've been trying to get the intl extension working on my test workstation (PHP 5.5.1, Apache 2.2.4, Windows 7 32-bit). It seems that no matter what I try I can't get it up and running. I've uncommented the line "extension=php_intl.dll" in my php.ini. I've verified the extension_dir directive is pointing at the correct directory (c:\wamp\php5.5\ext). I've verified php_intl.dll is in c:\wamp\php5.5\ext. I've verified that all the icu*.dll files are present in the php root directory (c:\wamp

Install intl PHP extension OSX High Sierra

狂风中的少年 提交于 2019-11-26 19:41:21
问题 How can I install intl PHP extension in PHP 7.1.7, which is delivered with osx high sierra? 回答1: So I had the exact same issue. As noted by other folks commenting here, High Sierra comes with PHP 7.1 installed and this PHP version has intl compiled with it In my case, I followed part of Neodork comment's in the following Valet+ issue: "Install" PHP 7.1 (so it comes from brew itself, not the one installed by High Sierra) brew install php@7.1 Upgrade it to latest version brew upgrade php@7.1

PHP Warning: Module already loaded in Unknown on line 0

元气小坏坏 提交于 2019-11-26 16:04:24
问题 On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying) PHP Warning: Module 'intl' already loaded in Unknown on line 0 I ran php --ini and the output was php --ini PHP Warning: Module 'intl' already loaded in Unknown on line 0 Warning: Module 'intl' already loaded in Unknown on line 0 Configuration File (php.ini) Path: /usr/local/etc/php/5.5 Loaded Configuration File: /usr/local/etc/php/5.5/php.ini