久久青草精品A片狠狠,日韩欧美视频一区二区,亚洲国码AV日韩,国产精品黄在

PHP大小寫(xiě)轉(zhuǎn)換詳解

2019-01-09 04:22:28 8231

strtoupper()


所有字母變大寫(xiě)




strtolower()


所有字母變小寫(xiě)




ucwords()


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




ucfirst()


第一個(gè)單詞首字母變大寫(xiě)




lcfirst()


第一個(gè)單詞首字母變小寫(xiě)




示例:


$foo = 'hello world!';

$foo = ucwords($foo);             // Hello World!

 

$bar = 'HELLO WORLD!';

$bar = ucwords($bar);             // HELLO WORLD!

$bar = ucwords(strtolower($bar)); // Hello World!

 

$foo = 'hello world!';

$foo = ucfirst($foo);             // Hello world!

 

$bar = 'HELLO WORLD!';

$bar = ucfirst($bar);             // HELLO WORLD!

$bar = ucfirst(strtolower($bar)); // Hello world!

 

$foo = 'HelloWorld';

$foo = lcfirst($foo);             // helloWorld

 

$bar = 'HELLO WORLD!';

$bar = lcfirst($bar);             // hELLO WORLD!

$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!


提交成功!非常感謝您的反饋,我們會(huì)繼續(xù)努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題: