位置: 编程技术 - 正文
推荐整理分享PHP字符串函数localeconv()的用法(php string函数),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:php字符串函数大全,在php中,字符串有哪些表示形式,php string函数,php 字符串函数,php 字符串函数,在php中,字符串有哪些表示形式,php字符串定义,php字符串型数据的定义方式,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 4 >= 4.0.5, PHP 5)
localeconv — Get numeric formatting information
说明 array localeconv ( void )Returns an associative array containing localized numeric and monetary formatting information.
返回值localeconv() returns data based upon the current locale as set by setlocale(). The associative array that is returned contains the following fields: Array element Description decimal_point Decimal point character thousands_sep Thousands separator grouping Array containing numeric groupings int_curr_symbol International currency symbol (i.e. USD) currency_symbol Local currency symbol (i.e. $) mon_decimal_point Monetary decimal point character mon_thousands_sep Monetary thousands separator mon_grouping Array containing monetary groupings positive_sign Sign for positive values negative_sign Sign for negative values int_frac_digits International fractional digits frac_digits Local fractional digits p_cs_precedes TRUE if currency_symbol precedes a positive value, FALSE if it succeeds one p_sep_by_space TRUE if a space separates currency_symbol from a positive value, FALSE otherwise n_cs_precedes TRUE if currency_symbol precedes a negative value, FALSE if it succeeds one n_sep_by_space TRUE if a space separates currency_symbol from a negative value, FALSE otherwise 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 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
The p_sign_posn, and n_sign_posn contain a string of formatting options. Each number representing one of the above listed conditions.
The grouping fields contain arrays that define the way numbers should be grouped. For example, the monetary grouping field for the nl_NL locale (in UTF-8 mode with the euro sign), would contain a 2 item array with the values 3 and 3. The higher the index in the array, the farther left the grouping is. If an array element is equal to CHAR_MAX, no further grouping is done. If an array element is equal to 0, the previous element should be used.
范例
Example #1 localeconv() example
<?phpif(false!==setlocale(LC_ALL,'nl_NL.UTF-8@euro')){$locale_info=localeconv();print_r($locale_info);}?>以上例程会输出:
参见setlocale() - Set locale information
PHP字符串函数htmlentities()的用法 htmlentities(PHP4,PHP5)htmlentitiesConvertallapplicablecharacterstoHTMLentities说明stringhtmlentities(string$string[,int$flags=ENT_COMPAT|ENT_HTML[,string$encoding=ini_get(default_charset)[,bool$
PHP字符串函数htmlspecialchars()的用法 htmlspecialchars(PHP4,PHP5)htmlspecialcharsConvertspecialcharacterstoHTMLentities说明stringhtmlspecialchars(string$string[,int$flags=ENT_COMPAT|ENT_HTML[,string$encoding=ini_get(default_charset)[
PHP字符串函数lcfirst()的用法 lcfirst(PHP5=5.3.0)lcfirst使一个字符串的第一个字符小写说明stringlcfirst(string$str)返回str的第一个字符小写了的字符串。如果str的第一个字符是字母,则将其
标签: php string函数
本文链接地址:https://www.jiuchutong.com/biancheng/279850.html 转载请保留说明!友情链接: 武汉网站建设