So, localeconv() seems to be ignoring the locale in my php script, and returns a basically empty array.
I've found numerous questions, etc. the answers to which all boiled down to the locale not being set correctly for Windows.
I believe this script is setting it using a valid value, and I can confirm the current locale is the one I want to use, but regardless of what the current locale is, localeconv() just returns the same (mostly) empty array.
What I'm looking to see is the mon_decimal_point and mon_thousands_separator values being populated with something.
So, my question is:
What do I have to do to get real results from localeconv()?
Sample script:
<?php
echo locale_get_default()."
";
echo setlocale(LC_MONETARY, locale_get_default()) . "
";
echo setlocale(LC_MONETARY, '0')."
";
$locale_info = localeconv();
print_r($locale_info);
echo setlocale(LC_MONETARY, null) ."
";
echo setlocale(LC_MONETARY, '0')."
";
$locale_info = localeconv();
print_r($locale_info);
Script output:
sve
Swedish_Sweden.1252
Swedish_Sweden.1252
Array
(
[decimal_point] => .
[thousands_sep] =>
[int_curr_symbol] =>
[currency_symbol] =>
[mon_decimal_point] =>
[mon_thousands_sep] =>
[positive_sign] =>
[negative_sign] =>
[int_frac_digits] => 127
[frac_digits] => 127
[p_cs_precedes] => 127
[p_sep_by_space] => 127
[n_cs_precedes] => 127
[n_sep_by_space] => 127
[p_sign_posn] => 127
[n_sign_posn] => 127
[grouping] => Array
(
)
[mon_grouping] => Array
(
)
)
English_United States.1252
English_United States.1252
Array
(
[decimal_point] => .
[thousands_sep] =>
[int_curr_symbol] =>
[currency_symbol] =>
[mon_decimal_point] =>
[mon_thousands_sep] =>
[positive_sign] =>
[negative_sign] =>
[int_frac_digits] => 127
[frac_digits] => 127
[p_cs_precedes] => 127
[p_sep_by_space] => 127
[n_cs_precedes] => 127
[n_sep_by_space] => 127
[p_sign_posn] => 127
[n_sign_posn] => 127
[grouping] => Array
(
)
[mon_grouping] => Array
(
)
)