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

PHP大小寫轉換詳解

2019-01-09 04:22:28 7527

strtoupper()


所有字母變大寫




strtolower()


所有字母變小寫




ucwords()


每個單詞的首字母轉換為大寫




ucfirst()


第一個單詞首字母變大寫




lcfirst()


第一個單詞首字母變小寫




示例:


$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!


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

這條文檔是否有幫助解決問題?

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

在文檔使用中是否遇到以下問題: