博客
关于我
php中几个字符函数小结
阅读量:114 次
发布时间:2019-02-26

本文共 705 字,大约阅读时间需要 2 分钟。

  下面小结PHP中的几个字符函数,小结一下:
1)ucfirst
   将首字母变大写,比如
  $string = "this is my web development blog";
echo ucfirst($string);
// Output: This is my web development blog
2) lcfirst,将首字母变小写
   $string = "This is my Web Development Blog";
echo lcfirst($string);
// Output: this is my Web Development Blog
3)strtoupper,将整个字符串变大写
   $string = "this is my web development blog";
echo strtoupper($string);
// Output: THIS IS MY WEB DEVELOPMENT BLOG
4) strtoplower,将整个字符串变小写
   $string = "tHiS is mY WeB DevElOpMenT bLoG";
echo strtolower($string);
// Output: this is my web development blog
5)ucwords(),可以将句子中每个单词的第一个字母变大写,比如
   $string = "this is my web development blog";
echo ucwords($string);
// Output: This Is My Web Development Blog

转载地址:http://nosf.baihongyu.com/

你可能感兴趣的文章
mxGraph改变图形大小重置overlay位置
查看>>
MongoDB可视化客户端管理工具之NoSQLbooster4mongo
查看>>
Mongodb学习总结(1)——常用NoSql数据库比较
查看>>
MongoDB学习笔记(8)--索引及优化索引
查看>>
mongodb定时备份数据库
查看>>
mppt算法详解-ChatGPT4o作答
查看>>
mpvue的使用(一)必要的开发环境
查看>>
MQ 重复消费如何解决?
查看>>
mqtt broker服务端
查看>>
MQTT 保留消息
查看>>
MQTT 持久会话与 Clean Session 详解
查看>>
MQTT工作笔记0007---剩余长度
查看>>
MQTT工作笔记0009---订阅主题和订阅确认
查看>>
Mqtt搭建代理服务器进行通信-浅析
查看>>
MS Edge浏览器“STATUS_INVALID_IMAGE_HASH“兼容性问题
查看>>
ms sql server 2008 sp2更新异常
查看>>
MS UC 2013-0-Prepare Tool
查看>>
MSBuild 教程(2)
查看>>
msbuild发布web应用程序
查看>>
MSB与LSB
查看>>