位置: 编程技术 - 正文

PHP字符串函数setlocale()的用法(php字符串变量)

编辑:rootadmin
setlocale

推荐整理分享PHP字符串函数setlocale()的用法(php字符串变量),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php字符串赋值,在php中,字符串有哪些表示形式,php字符串型数据的定义方式,php字符串赋值,php string函数,php string函数,php字符串定义的三种方式,php字符串定义,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4, PHP 5)

setlocale — Set locale information

说明 string setlocale ( int $category , string $locale [, string $... ] ) string setlocale ( int $category , array $locale )

Sets locale information.

参数

category

category is a named constant specifying the category of the functions affected by the locale setting: LC_ALL for all of the below LC_COLLATE for string comparison, see strcoll() LC_CTYPE for character classification and conversion, for example strtoupper() LC_MONETARY for localeconv() LC_NUMERIC for decimal separator (See also localeconv()) LC_TIME for date and time formatting with strftime() LC_MESSAGES for system responses (available if PHP was compiled with libintl)

locale

If locale is NULL or the empty string "", the locale names will be set from the values of environment variables with the same names as the above categories, or from "LANG".

If locale is "0", the locale setting is not affected, only the current setting is returned.

If locale is an array or followed by additional parameters then each array element or parameter is tried to be set as new locale until success. This is useful if a locale is known under different names on different systems or for providing a fallback for a possibly not available locale.

...

(Optional string or array parameters to try as locale settings until success.)

Note: PHP字符串函数setlocale()的用法(php字符串变量)

On Windows, setlocale(LC_ALL, &#;&#;) sets the locale names from the system&#;s regional/language settings (accessible via Control Panel).

返回值

Returns the new current locale, or FALSE if the locale functionality is not implemented on your platform, the specified locale does not exist or the category name is invalid.

An invalid category name also causes a warning message. Category/locale names can be found in »RFC and »ISO . Different systems have different naming schemes for locales.

Note:

The return value of setlocale() depends on the system that PHP is running. It returns exactly what the system setlocale function returns.

更新日志

版本 说明 5.3.0 This function now throws an E_DEPRECATED notice if a string is passed to the category parameter instead of one of the LC_* constants.

范例

Example #1 setlocale() Examples

<?php/*SetlocaletoDutch*/setlocale(LC_ALL,'nl_NL');/*Output:vrijdagdecember*/echostrftime("%A%e%B%Y",mktime(0,0,0,,,));/*trydifferentpossiblelocalenamesforgermanasofPHP4.3.0*/$loc_de=setlocale(LC_ALL,'de_DE@euro','de_DE','de','ge');echo"Preferredlocaleforgermanonthissystemis'$loc_de'";?>

Example #2 setlocale() Examples for Windows

<?php/*SetlocaletoDutch*/setlocale(LC_ALL,'nld_nld');/*Output:vrijdagdecember*/echostrftime("%A%d%B%Y",mktime(0,0,0,,,));/*trydifferentpossiblelocalenamesforgermanasofPHP4.3.0*/$loc_de=setlocale(LC_ALL,'de_DE@euro','de_DE','deu_deu');echo"Preferredlocaleforgermanonthissystemis'$loc_de'";?>

注释 Warning

The locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server API like IIS or Apache on Windows, you may experience sudden changes in locale settings while a script is running, though the script itself never called setlocale(). This happens due to other scripts running in different threads of the same process at the same time, changing the process-wide locale using setlocale().

Tip

Windows users will find useful information about locale strings at Microsoft&#;s MSDN website. Supported language strings can be found in the »language strings documentation and supported country/region strings in the »country/region strings documentation.

PHP字符串函数sha1_file()的用法 sha1_file(PHP4=4.3.0,PHP5)sha1_file计算文件的sha1散列值说明stringsha1_file(string$filename[,bool$raw_output=false])利用美国安全散列算法1,计算并返回由filename指定的文件

PHP字符串函数rtrim()的用法 rtrim(PHP4,PHP5)rtrim删除字符串末端的空白字符(或者其他字符)说明stringrtrim(string$str[,string$charlist])该函数删除str末端的空白字符并返回。不使用第二个参

PHP字符串函数quoted_printable_decode()的用法 quoted_printable_decode(PHP4,PHP5)quoted_printable_decode将quoted-printable字符串转换为8-bit字符串说明stringquoted_printable_decode(string$str)该函数返回quoted-printable解码之后

标签: php字符串变量

本文链接地址:https://www.jiuchutong.com/biancheng/278841.html 转载请保留说明!

上一篇:PHP字符串函数similar_text()的用法(php字符串型数据的定义方式)

下一篇:PHP字符串函数sha1_file()的用法(php字符串函数大全)

  • 什么是银行税贷产品
  • 安装费人工费有什么不一样
  • 已出库未开票要交税吗
  • 普通发票有没有有效期
  • 母子公司借款要交什么税
  • 进销存明细账怎么填写
  • 以前年度损益调整会计分录
  • 旅游费用可以报销吗
  • 嵌入式软件运行的主要流程是什么
  • 评估价值高于账面价值怎么收税
  • 外请人员所发生的费用怎么做账
  • 挂靠管理费有收税前还是收税后?
  • 财产租赁合同印花税计税依据及税率
  • 有税收完税证明还需要发票吗
  • 纳税总额包括
  • 技术开发费税收优惠政策
  • 农产品销售发票是什么?
  • 普通发票和增值税发票都能报销吗
  • 雄安新区纳入综合考核
  • 汇算清缴涉及到哪些科目的调整
  • 工程质保金扣除
  • 管理费用月末结账
  • 亏损合同如何处理
  • 科技项目经费怎么申报
  • 应收账款年末余额过大
  • 应纳税所得额未减上季度所得税,下季度可补减吗
  • 网店提现要多久能到账
  • 出售已使用五年的住房有税收优惠吗?
  • 借贷记账法的记账规则是
  • 施工项目直接成本和间接成本
  • 金蝶怎么一次性删除所有分录
  • 给员工购买的意外保险可以税前扣除
  • 应收账款重分类什么意思
  • mac怎么同步
  • win10一键释放内存
  • apache运行php
  • win10改头像怎么删除以前的头像
  • 固定资产生产经营期间正常报废产生的净收益
  • 人脸清晰化神器软件
  • thinkphp i方法
  • 更换电脑金税盘的数据如何导入新电脑
  • 公司年终奖怎么入账
  • 印花税应计入什么
  • 小规模固定资产处置税率
  • 织梦论坛
  • 代扣税费分录
  • 公司注销了就可以不发工资么
  • 递延收益的摊销时点
  • 城建税免征怎么记账
  • 公司注销清算时个人股东如何计算个人所得税
  • 合并财务报表为什么要抵消子公司所有者权益
  • 实收资本变更登记
  • 应收利息的会计分录怎么写
  • 在建工程抵押贷款的用途为在建工程继续建造所需资金
  • 库存不够如何结算成本
  • 母子公司合并报表实操
  • 电子税务局财务报表在哪里查询
  • 建筑企业外地预缴
  • 折现率算现值公式
  • 企业应该设置几个安全管理人员
  • xp系统直接开机
  • windows 08
  • Mac安装不了iTunes
  • CentOS EXT4文件系统的详解
  • 无光驱是不是放不了光盘
  • xp系统怎样设置无线网络连接
  • mac安装字体方法
  • linux命令nano
  • explorer.exe中文叫什么
  • linuxzen
  • win7系统怎么设置电源
  • windows日历
  • iptables入门
  • 下列关于android的说法中,错误的是
  • 完美解决gvim的菜单乱码问题
  • android多语言失效
  • 国税局下设几个部门
  • 清税申报表怎么填写
  • 怎么在国税网站取消已申报的财务报表
  • 上海如何用电子医保卡
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设