PHP localeconv() function

Wurin amfani

Na ba da bayanin soni kan hanyar kwamfuta na Amurka:

<?php
setlocale(LC_ALL,"US");
$locale_info = localeconv();
print_r($locale_info);
?>

Wurin amfani

Tarihi da amfani

localeconv() function zai cire wata takardun abin da suka ba da kuma abin da ya zama na bayanin alama na soni da hanyar kwamfuta

localeconv() function zai cire takardun abin da suka ba da kuma abin da ya zama na bayanin alama na soni da hanyar kwamfuta

  • [decimal_point] - Daya na kwarin
  • [thousands_sep] - Daya na biliya
  • [int_curr_symbol] - Daya na kwamfuta (masu misali: USD)
  • [currency_symbol] - Daya na kwamfuta (masu misali: $)
  • [mon_decimal_point] - Daya na kwarin na kwamfuta
  • [mon_thousands_sep] - Daya na biliya na kwamfuta
  • [positive_sign] - Akwai wani daya na wucin gadi
  • [negative_sign] - Akwai wani daya na kwarin
  • [int_frac_digits] - Dima kwarin guda na kasa da kasa
  • [frac_digits] - Dima kwarin guda
  • [p_cs_precedes] - Haɗa daya da kwamfuta ya zama cikin bayan mazauni, to da True (1), kuma a baya False (0)
  • [p_sep_by_space] - Haɗa a baiwa dama tsakiya da mazauni a cikin daya da kwamfuta, to da True (1), kuma a baya False (0)
  • [n_cs_precedes] - If the currency symbol is displayed before a negative value, it is True (1), if it is displayed after a negative value, it is False (0)
  • [n_sep_by_space] - If there is a space between the currency symbol and the negative value, it is True (1), otherwise False (0)
  • [p_sign_posn] - Formatting options:
    • 0 - Write the number and currency symbol in parentheses
    • 1 - Add a plus sign before the number and currency symbol
    • 2 - Add a plus sign after the number and currency symbol
    • 3 - Add a plus sign directly before the currency symbol
    • 4 - Add a plus sign directly after the currency symbol
  • [n_sign_posn] - Formatting options:
    • 0 - Write the number and currency symbol in parentheses
    • 1 - Add a hyphen before the number and currency symbol
    • 2 - Add a hyphen after the number and currency symbol
    • 3 - Add a hyphen directly before the currency symbol
    • 4 - Add a hyphen directly after the currency symbol
  • [grouping] - Show array of number combinations (for example: 3 indicates 1 000 000)
  • [mon_grouping] - Show array of currency number combinations (for example: 2 indicates 1 00 00 00)

Hint:To define local settings, please see setlocale() Functions.

Hint:To see all available language codes, please visit ourLanguage code reference manual.

Syntax

localeconv()

Technical details

Return value: Return data based on the current locale set by setlocale().
PHP version: 4.0.5+