Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Programming General (http://siteownersforums.com/forumdisplay.php?f=44)
-   -   Get PHP country name from code (http://siteownersforums.com/showthread.php?t=172856)

sansastark 07-11-2016 06:23 PM

Get PHP country name from code
 
If you are investigating the Buy product acquiring the country_id of GB, nonetheless you'll need Uk, the subsequent code might be made use of, merely a fast snippet of code that could return you the Region Title dependent on the region code, e.g:

Code:

Mage: :software()->getLocale()->getCountryTranslation($country_id);
Only go as part of your state id price (e.g GB) and Magento will return the complete place identify.

project 07-17-2016 03:22 PM

If you are investigating the Buy product acquiring whmcs coupon the country_id of GB, nonetheless you'll need Uk, the subsequent code might be made use of, merely a fast snippet of code that could return you the Region Title dependent on the region code, e.g: whmcs discount and whmcs coupon code 2016

smmexpertss 07-18-2016 01:00 AM

You don't have to have a fully-formed locale for the first parameter. This makes the function useful for getting the country name from any locale:

var_dump(Locale::getDisplayRegion('-US', 'fr'));

//Returns
string 'États-Unis' (length=11)
?>


All times are GMT -7. The time now is 10:04 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.