setlocale and currency_symbol
Posted: Mon Nov 20, 2006 5:26 pm
feyd | Please use
which correctly outputs:
but i have another site on the same server that outputs a question mark for currency_symbol and i can't for the life of me figure out why. any clues?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
for some reason when i use setlocale for certain(most) regions I get a ? for currency_symbol. i'm pretty sure this isn't a problem with my server or it's os because a created a test page with this:Code: Select all
<?php
$loc = setlocale( LC_ALL, "eng" );
echo( setlocale( LC_ALL, 0 ) );
echo( "<br /><br />" );
$locInfo = localeconv();
echo( var_dump( $locInfo ) );
echo( "<br /><br />" );
echo( $locInfo[ 'currency_symbol' ] );
?>Code: Select all
English_United Kingdom.1252
array(18) { ["decimal_point"]=> string(1) "." ["thousands_sep"]=> string(1) "," ["int_curr_symbol"]=> string(3) "GBP" ["currency_symbol"]=> string(1) "£" ["mon_decimal_point"]=> string(1) "." ["mon_thousands_sep"]=> string(1) "," ["positive_sign"]=> string(0) "" ["negative_sign"]=> string(1) "-" ["int_frac_digits"]=> int(2) ["frac_digits"]=> int(2) ["p_cs_precedes"]=> int(1) ["p_sep_by_space"]=> int(0) ["n_cs_precedes"]=> int(1) ["n_sep_by_space"]=> int(0) ["p_sign_posn"]=> int(3) ["n_sign_posn"]=> int(3) ["grouping"]=> array(1) { [0]=> int(3) } ["mon_grouping"]=> array(1) { [0]=> int(3) } }
£feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]