logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



PHP localeconv() does not return a reasonable array ?

 
Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner



View previous topic :: View next topic  
Author Message
rockjock



Joined: 25 Mar 2011
Posts: 8

PostPosted: Mon 10 Jun '13 17:01    Post subject: PHP localeconv() does not return a reasonable array ? Reply with quote

Splitted from www.apachelounge.com/viewtopic.php?p=24858

I have trouble getting this snippet to run properly with the PHP 5.4.16 x64 build:

setlocale(LC_ALL,"French_France");
print_r(localeconv());

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
(
)

)
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6255
Location: Germany, Next to Hamburg

PostPosted: Mon 10 Jun '13 17:18    Post subject: Reply with quote

rockjock wrote:

setlocale(LC_ALL,"French_France");


fra_fra is correct. See http://msdn.microsoft.com/en-us/library/39cwe7zf%28v=vs.90%29.aspx


try
Code:

<?php

setlocale(LC_ALL, 'fra_fra');

echo strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));

$loc_de = setlocale(LC_ALL, 'fr_FR@euro', 'fr_FR', 'fra_fra');
echo "Preferred locale for frensh on this system is '$loc_de'";
?>
Back to top
rockjock



Joined: 25 Mar 2011
Posts: 8

PostPosted: Mon 10 Jun '13 17:53    Post subject: Reply with quote

strftime() returns correct values. Unfortunately localeconv() does not return a reasonable array.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1