位置: 编程技术 - 正文

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

  • 小规模纳税人享受1%的税率
  • 年初结转增值税社保如何做账
  • 企业所得税纳税义务人
  • 特定减免税货物的通关程序为
  • 企业销售商品房需要缴纳什么税费
  • 企业社会保险登记表
  • 天猫费率是什么
  • 试用期社保是按照应发工资缴纳吗
  • 企业股权转让留存收益可以扣除吗
  • 应交税费进项税额属于什么科目借贷方向
  • 未进行账务处理违反什么
  • 租赁的土地被征迁
  • 企业委托银行收款,银行以办妥手续,而企业尚未收到凭证
  • 多计费用以前年度损益调整
  • 新公司第一个月报税怎么弄
  • 折扣折让的销售方式有哪些
  • 销售时无法确认发票
  • 咨询服务费属于什么会计科目
  • 生产企业出口退税流程及账务处理
  • 税率开错跨月没法收回
  • 河北省东光县是哪个城市
  • 不得免征和抵扣的税额
  • 发票在验旧日期之后作废吗
  • 现金福利支出需要申报个税吗
  • 已经认证的发票怎么冲红
  • 多结转成本的会计分录
  • ie异常
  • 买mac要买applecare么
  • 初中英语的学科知识与能力主要考什么
  • 分期付款买车的利息会计分录
  • PHP:session_write_close()的用法_Session函数
  • php轻松入门视频教程
  • PHP - EasyUI DataGrid 资料取的方式介绍
  • 实际收到的货款怎么做账
  • 会计科目怎么调账
  • 下一页分页符中间空白页
  • 对于小型微利企业的建议
  • php504错误
  • 计算机领域划分
  • uniapp获取手机通讯录
  • yolo s
  • Php实现注解注入
  • 其他应收款如何计提减值准备
  • 单位代扣公积金是什么意思
  • 国家企业信用公示信息公示
  • 海关报关单位注销操作规程
  • 购买员工团体意外险流程
  • 工会会计固定基金
  • 个税如果是公司怎么申报
  • 销售退回会计分录
  • 员工周转房管理办法
  • 所得税弥补以前年度亏损是几年
  • 出口退税的会计科目
  • 红冲暂估原材料如何做会计分录
  • 投资性房地产转换计入其他综合收益
  • 项目建设期间所涉及的税
  • 非税收入定额票据是什么
  • 公司买茶具帐务处理流程
  • 增值税普通发票查询
  • 登记银行存款日记账的实训心得
  • 职工福利费扣除税率
  • centos7 阿里云 yum
  • Fedora 9.0 Apache+PHP+MYSQL 环境安装
  • 数字签名方法不提供
  • 安装linux出现grub的原因
  • windows10 14393版本
  • 微信小程序实现轮播图
  • 遮罩层中对象的作用是
  • python3.7内置模块
  • 权作记录 cocos2dx
  • android开发中遇到的问题
  • nodejs 调用命令行
  • vue组件精讲
  • 编写shell脚本,批量建立用户
  • 对xmlHttp对象的理解
  • jquery切换css样式
  • 使用筷子就餐会不会传染乙肝病毒
  • js跨域访问页面控件
  • 甘肃职称申报评审入口官网
  • 医保属于地税还是国税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设