国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

PHP大小寫轉換詳解

2019-01-09 04:22:28 3040

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!


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

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

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

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