位置: 编程技术 - 正文

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字符串函数大全)

  • 出口退税一般退什么税
  • 小规模纳税人通用申报表
  • 个人代开资金占用费,如何计算代扣代缴个税
  • 手机上可以开个人劳务发票吗
  • 预付款被退回分录
  • 以不动产投资入股增值税
  • 事业单位资产划转流程
  • 计提代扣代缴个人缴纳的社会保险费分录
  • 铁路大票抵扣几个点
  • 提取法定盈余公积会计分录
  • 主营业务收入如何红冲
  • 未分配利润转出
  • 公益性捐赠纳税调整案例
  • 衍生金融资产的核算
  • 现金流量表中收入怎么算
  • 记账凭证一定要签字吗
  • 私人房产无偿赠个人所得税需要缴纳吗?
  • 可以把两张发票合写在记账凭证上吗
  • 劳务公司开的3%专用发票能抵扣吗
  • 体检发票开公司还是个人
  • 减免所得税额明细表
  • 机票的抵扣率是多少
  • 金税盘年费怎么做账
  • 怎么查询公司有没有开社保户
  • 公司注销必须要清算报告吗
  • 金融企业贷款利率
  • 取得带息应收票据时,企业应于期末计算票据利息
  • 技术服务费成本票是什么
  • 税控专用设备全额抵扣
  • 银行承兑汇票贴现流程
  • 赠品没有收到
  • 华为手机开热点后wlan自动关闭
  • oauth认证流程
  • 增值税发票开红字发票后账务处理?
  • vue的自定义指令怎么用
  • php exit绕过
  • 雪花 (© TothGaborGyula/Getty Images Plus)
  • php执行linux脚本
  • 语言翻译算法
  • 研发支出属于哪个表
  • 水利建设基金计税依据
  • php和mysql的联合使用
  • php中array_unshift()修改数组key注意事项分析
  • vue-axios详细介绍
  • 模式识别与图像处理能做什么
  • chage -l命令
  • 材料采购计入哪个账本
  • 注册公司填写从业人数多少合适
  • emacs scheme
  • 帝国cms到底好不好
  • 唐山发生5.1级地震
  • c语言中sizeof是啥意思
  • 织梦怎样实现文件上传
  • 无形资产减值准备可以转回吗
  • 个人股权转让需要评估吗
  • 金蝶财务软件怎么备份
  • 销售货物提供运输服务分录
  • 非公司人员差旅怎么报销
  • 其他收益结转到什么科目
  • 所得税为负数会计分录
  • 实际上缴税费总额怎么算
  • 收不回来的应收账款
  • 小企业会计核算论文
  • 未确认融资费用借贷方向
  • centos coreos
  • Win7系统不小心将TCP/IP协议卸载如何重新安装?
  • win8.1无法启动
  • efs加密解除
  • Win10 Mobile/PC/HoloLens一周年更新14389曝光
  • win7打开文件总是询问
  • windows8怎么搜索文件
  • 基于HTML5和CSS3的响应式Web的设计与实现
  • Android 开源项目集合
  • javascript面向对象精要
  • 吉林省税务局发票查询真伪
  • 税务ukey怎么升级不了
  • 因公出差伙食补助标准
  • oecd国家是什么意思
  • 如何理解新时代新征程党的使命任务
  • 国网成都市局和绵阳市局的区别?
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设