Core PHP

Regional String Functions

Regional String Functions
convert_cyr_string()
string convert_cyr_string(string $sConvert, string $sFromCharSet, string $sToCharSet)
This function returns a string version of $sConvert with the Cyrillic character of the set $sFromCharSet replaced with the characters of $sToCharSet. The supported character sets are as follows
  • a - x-cp866
  • d - x-cp866
  • i - iso8859-5
  • k - koi8-r
  • m - x-mac-cyrillic
  • w - windows-1251
Argument Description
string $sConvert This is the initial string that is to be converted.
string $sFromCharSet This is the initial character set of $sConvert. It is designated by a single letter in the list above.
string $sConvert This is the character set of returned string. It is designated by a single letter in the list above.
hebrev()
string hebrev(string $sHebrew, int $iMaxCharsPerLine = 0)
This function returns a string version of visual corverted from the logical Hebrew text string $sHebrew.
Argument Description
string $sHebrew This is the initial Hebrew string that is to be converted.
int $iMaxCharsPerLine This is the maximum characters per line.
hebrevc()
string hebrevc(string $sHebrew, int $iMaxCharsPerLine = 0)
This function returns a string version of visual corverted from the logical Hebrew text string $sHebrew. It is the same as hebrev(), except that '\n' is converted to '
'.
Argument Description
string $sHebrew This is the initial Hebrew string that is to be converted.
int $iMaxCharsPerLine This is the maximum characters per line.
localeconv()
array localeconv()
This function returns an array of information on localized monetary and numeric formatting. The associate array elements are as follows:
  • currency_symbol - The character representing the currency symbol
  • decimal_point - The character representing a radix or decimal point
  • frac_digits - The local fractional digits
  • grouping - An array containing numeric groupings
  • int_curr_symbol - The international currency symbol (USD)
  • int_frac_digits - The international fractional digits
  • mon_decimal_point - The monetary decimal point character
  • mon_grouping - An array containing monetart groupings
  • mon_thousands_sep - The monetary thousands separator character
  • n_cs_precedes - TRUE if the currency symbol precedes the negative value
  • n_sep_by_space - TRUE if a space separates the currecny symbol from the negative value
  • n_sign_posn
    • 0 - Parentheses surround the quantity and currency_symbol
    • 1 - The sign string precedes the quantity and currency_symbol
    • 2 - The sign string succeeds the quantity and currency_symbol
    • 3 - The sign string immediately precedes the currency_symbol
    • 4 - The sign string immediately succeeds the currency_symbol
  • negative_sign - The sign character for negative values
  • p_cs_precedes - TRUE if the currency symbol precedes the positive value
  • p_sep_by_space - TRUE if a space separates the currecny symbol from the positive value
  • p_sign_posn
    • 0 - Parentheses surround the quantity and currency_symbol
    • 1 - The sign string precedes the quantity and currency_symbol
    • 2 - The sign string succeeds the quantity and currency_symbol
    • 3 - The sign string immediately precedes the currency_symbol
    • 4 - The sign string immediately succeeds the currency_symbol
  • positive_sign - The sign character for positive values
  • thousands_sep - The character that is used as a separator in for the thousands place and at every third decimal place.
money_format()
string money_format(string $sFormat, double $dValue)
This function returns a monetarily formatted version of $dValue.
Argument Description
string $sFormat This is the format specification.
double $dValue This is the value that will be formatted.
nl_langinfo()
string nl_langinfo(ing $iItem)
This function returns a specific element of the locale.
Argument Description
ing $iItem This is the item that is to be returned.
number_format()
string number_format(float $fValue, int $iAfterRadix = 0, string $sRadix = ".", string $sThousands = ",")
This function returns the string corresponding to $fValue with $iAfterRadix digits after the decimal or radix point. The number is fomatted with the string $sRadix as decimal or radix point and the string $sThousands after the thousands digit.
Argument Description
float $fValue This is the value that is to be represented.
int $iAfterRadix This is number of digits that are to be displayed after the decimal point.
string $sRadix This is the string that will represent the decimal or radix point. Some countries use a different character, instead of the period.
string $sThousands This is the string that will represent the separator for every thousand multiple. Some countries use a different character, instead of the comma.
setlocale()
string setlocale(ing $iCategory, various $xLocale)
This function returns the specific, requested locale.
Argument Description
ing $iCategory This is the category of functions that are affected by the locale.
various $xLocale This is an array or a string that specifies a locale.
 
 

© 2007–2024 XoaX.net LLC. All rights reserved.