php中几个字符函数小结
2013-07-01 17:41
579 查看
下面小结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
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
相关文章推荐
- php中几个字符函数小结
- 分享php中几个字符函数小结
- PHP字符转义相关函数小结(php下的转义字符串)
- PHP中字符安全过滤函数使用小结
- PHP中字符安全过滤函数使用小结
- PHP字符转义相关函数小结(php下的转义字符串)
- PHP字符转义相关函数小结(php下的转义字符串)
- PHP字符转义相关函数小结(php下的转义字符串)
- php字符分割的几个函数
- PHP中字符安全过滤函数使用小结
- php常用字符函数实例小结
- 【转】PHP字符转义相关函数小结
- PHP几个实用自定义函数小结
- php中日期处理的几个函数,小结一下
- PHP中字符安全过滤函数使用小结
- PHP几个实用自定义函数小结
- php中几个字符处理函数的说明
- 分享几个php经常用到的数学函数,常玩数据的猿哥猿姐们学习了
- PHP iconv()函数转字符编码的问题
- PHP编程:函数、字符、时间、变量、表单