PHP英文字母大小寫(xiě)轉(zhuǎn)換函數(shù)小結(jié)
每個(gè)單詞的首字母轉(zhuǎn)換為大寫(xiě):ucwords()
$foo = 'hello world!';
$foo = ucwords($foo); // Hello World!
$bar = 'HELLO WORLD!';
$bar = ucwords($bar); // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>
第一個(gè)單詞首字母變大寫(xiě):ucfirst()
$foo = 'hello world!';
$foo = ucfirst($foo); // Hello world!
$bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>
第一個(gè)單詞首字母變小寫(xiě):lcfirst()
$foo = 'HelloWorld';
$foo = lcfirst($foo); // helloWorld
$bar = 'HELLO WORLD!';
$bar = lcfirst($bar); // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!
?>
所有字母變大寫(xiě):strtoupper()
所有字母變小寫(xiě):strtolower()
- PHP隨機(jī)字符串生成代碼(包括大小寫(xiě)字母)
- PHP stristr() 函數(shù)(不區(qū)分大小寫(xiě)的字符串查找)
- PHP將字符串首字母大小寫(xiě)轉(zhuǎn)換的實(shí)例
- PHP字符串word末字符實(shí)現(xiàn)大小寫(xiě)互換的方法
- php大小寫(xiě)轉(zhuǎn)換函數(shù)(strtolower、strtoupper)用法介紹
- php根據(jù)操作系統(tǒng)轉(zhuǎn)換文件名大小寫(xiě)的方法
- PHP 實(shí)現(xiàn)人民幣小寫(xiě)轉(zhuǎn)換成大寫(xiě)的方法及大小寫(xiě)轉(zhuǎn)換函數(shù)
- PHP實(shí)現(xiàn)字符串大小寫(xiě)轉(zhuǎn)函數(shù)的功能實(shí)例
相關(guān)文章
php-perl哈希算法實(shí)現(xiàn)(times33哈希算法)
php-perl哈希實(shí)現(xiàn)算法–DJBX33A(Daniel J. Bernstein, Times 33 with Addition)APR哈希默認(rèn)算法2013-12-12php 模擬GMAIL,HOTMAIL(MSN),YAHOO,163,126郵箱登錄的詳細(xì)介紹
本篇文章是對(duì)php模擬GMAIL,HOTMAIL(MSN),YAHOO,163,126郵箱登錄的方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06php獲得客戶端瀏覽器名稱及版本的方法(基于ECShop函數(shù))
這篇文章主要介紹了php獲得客戶端瀏覽器名稱及版本的方法,基于ECShop函數(shù)get_user_browser實(shí)現(xiàn)該功能,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-12-12無(wú)法載入 mcrypt 擴(kuò)展,請(qǐng)檢查 PHP 配置終極解決方案
今天運(yùn)行phpmyadmin的時(shí)候,提示無(wú)法載入 mcrypt 擴(kuò)展,經(jīng)排查原來(lái)是php配置問(wèn)題。2011-07-07PHP基于PDO實(shí)現(xiàn)的SQLite操作類【包含增刪改查及事務(wù)等操作】
這篇文章主要介紹了PHP基于PDO實(shí)現(xiàn)的SQLite操作類,包含增刪改查及事務(wù)等操作實(shí)現(xiàn)技巧與使用方法,需要的朋友可以參考下2017-06-06php 出現(xiàn)Strict Standards: Only variables should be passed by r
這個(gè)問(wèn)題多半是因?yàn)橐脗鬟f參數(shù)引起的,解決辦法一是修改代碼不使用引用傳遞,需要的朋友可以參考下2017-08-08