亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

PHP英文字母大小寫轉(zhuǎn)換函數(shù)小結(jié)

 更新時(shí)間:2014年05月03日 08:24:18   作者:  
這篇文章主要介紹了幾個(gè)PHP英文字母大小寫轉(zhuǎn)換函數(shù),分為首字母大小寫轉(zhuǎn)換和所有字母大小寫轉(zhuǎn)換,需要的朋友可以參考下

每個(gè)單詞的首字母轉(zhuǎn)換為大寫:ucwords()

復(fù)制代碼 代碼如下:
<?php
$foo = 'hello world!';
$foo = ucwords($foo);             // Hello World!

$bar = 'HELLO WORLD!';
$bar = ucwords($bar);             // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>

第一個(gè)單詞首字母變大寫:ucfirst()

復(fù)制代碼 代碼如下:
<?php
$foo = 'hello world!';
$foo = ucfirst($foo);             // Hello world!

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

第一個(gè)單詞首字母變小寫:lcfirst()

復(fù)制代碼 代碼如下:
<?php
$foo = 'HelloWorld';
$foo = lcfirst($foo);             // helloWorld

$bar = 'HELLO WORLD!';
$bar = lcfirst($bar);             // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!
?>

所有字母變大寫:strtoupper()
所有字母變小寫:strtolower()

相關(guān)文章

最新評(píng)論