论坛
门户
内部优惠
喜欢
话题
VIP会员
搜索
新浪微博
登录
注册
100%
100%
首页
>
网页设计
>
php技术
>
分享php中几个字符函数小结
回复
« 返回列表
灯火互联
管理员
注册日期
2011-07-27
发帖数
41778
QQ
火币
41290枚
粉丝
1086
关注
100
加关注
写私信
打招呼
阅读:
3193
回复:
0
分享php中几个字符函数小结
楼主
#
更多
只看楼主
倒序阅读
发布于:2012-01-31 22:50
保存
100%
100%
[]
1
下面小结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
喜欢
0
评分
0
最新喜欢:
淘宝天猫隐藏优惠券地址
回复
100%
发帖
回复
« 返回列表
普通帖
您需要登录后才可以回帖,
登录
或者
注册
100%
返回顶部
关闭
最新喜欢