每个单词的首字母转换为大写:ucwords()

<?php
$foo = 'hello world!';
$foo = ucwords($foo); // Hello World! $bar = 'HELLO WORLD!';
$bar = ucwords($bar); // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>

第一个单词首字母变大写:ucfirst()

<?php
$foo = 'hello world!';
$foo = ucfirst($foo); // Hello world! $bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>

第一个单词首字母变小写:lcfirst()

<?php
$foo = 'HelloWorld';
$foo = lcfirst($foo); // helloWorld $bar = 'HELLO WORLD!';
$bar = lcfirst($bar); // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!
?>

所有 字母变大写:strtoupper()

所有 字母变小写:strtolower()

最新文章

  1. 在Windows7上如何找到Cookie(亲测100%可找到)
  2. Git的奇技淫巧&#128584;
  3. Effective C++ 之 Item 5:了解C++默默编写并调用哪些函数
  4. Chp18: Hard
  5. C#学习笔记---基础入门(三)
  6. Servlet3.0学习总结(一)——使用注解标注Servlet
  7. Cocos2d-x内存自动释放机制--透彻篇
  8. SQL Server2008 附加数据库失败 错误代码5120
  9. Contest20140705 testA 二分
  10. memcache锁
  11. 你能相信吗?这些都是由一个DIV元素实现的动画,纯CSS3技术
  12. 4天html总结
  13. Java 字节流操作
  14. 网络流24题 P1251 餐巾计划问题 拆点
  15. adb push 中文路径文件名丢失后缀
  16. Idea使用Maven创建Java Web项目
  17. CNN卷积核反传分析
  18. Keil5下载STM32库
  19. centos内存自动清理脚本及限制tomcat内存占用
  20. [Linux]如何查看系统的Time Slice

热门文章

  1. 【2016-09-27-DP小练】
  2. 51nod 1076 2条不相交的路径
  3. 【Atcoder】ARC 080 E - Young Maids
  4. UVALIVE 4330 Timer
  5. Basic-Paxos原理
  6. Java常见知识点(二)
  7. ajax按钮改变数据状态
  8. 在servlet中返回json数据
  9. [UML] 如何找参与者、找用例
  10. HDU 1061.Rightmost Digit-规律题 or 快速幂取模