【PHP】ひらがな・カタカナの小文字(小書き文字)を大文字にする方法

スポンサーリンク

ここで言う、小文字(小書き文字)とは、「かわじゃん」、「あいみょん」、「しゅりけん」、「カッパ」、「ぐぁわし」等、
「ゃ」「ゅ」「ょ」「っ」の文字のことを言います。
小書き文字は、別名「小書き」、「小文字」、「小さい文字」、「つまる音」、「つまった音」等と呼ばれたりします。

PHPで、この促音を通常の大きな文字に変換する方法は以下のとおりです。

mb_convert_kana関数で変換できそうですが、設定できるオプションは存在しないので、独自の関数を定義して、それを使用します。

function kana_small_to_large($subject) {
    $search = Array('ぁ','ぃ','ぅ','ぇ','ぉ','っ','ゃ','ゅ','ょ','ゎ','ァ','ィ','ゥ','ェ','ォ','ッ','ャ','ュ','ョ','ヮ');
    $replace = Array('あ','い','う','え','お','つ','や','ゆ','よ','わ','ア','イ','ウ','エ','オ','ツ','ヤ','ユ','ヨ','ワ');
    return str_replace($search, $replace, $subject);
}

//使用例

echo kana_small_to_large('カッパ'); //カツパ

さらに、半角カタカナに変換するには、以下のように記載します。

echo mb_convert_kana(kana_small_to_large('カッパ'), 'h'); //カツパ

 

コメント

rtp live

rtp slot

slot bet 200

bonus new member

rtp slot gacor

situs slot777

joker123

idn poker

situs joker123

rtp

slot bet kecil

slot bonus

depo 25 bonus 25

baccarat online

slot server thailand

sbobet

slot garansi kekalahan

slot bonus new member

sbobet88

slot bonus

slot777 gacor

situs slot bet kecil

slot777

slot bonus new member 100

slot777 gacor

rtp slot gacor hari ini

slot bet

slot88

slot88 resmi

slot gacor hari ini

slot777 login

slot88

slot gampang maxwin

rtp slot tertinggi

starlight princess

bonus new member

wisdom of athena

mochimon

slot 200

slot bet 200

slot777 online

slot777 gacor

jurrasic kingdom

sugar rush

aztec gems

bonus new member

mahjong ways

bonus new member 100

caishen wins

caishen wins slot

slot777 gacor

tree of riches slot

aztec slot

lucky neko slot

rtp slot

slot gacor

slot88 resmi

situs slot

https://slotbonus.softcia.com.br

https://slotbonus.deparmotor.com/

bonus new member

slot777

rtp slot

slot 777

bonus new member

https://adresa-telefony.ru/img/slot777/

https://adresa-telefony.ru/img/joker123/

https://adresa-telefony.ru/img/sbobet/

https://rtp-slot.nwbc.com.au/

https://realesaletter.com/js/sbobet/

https://realesaletter.com/js/slot777/

https://www.yg-moto.com/wp-includes/bet-kecil/

https://pri-israel.com/wp-includes/bet-kecil/

https://www.contato10.com.br/wp-includes/slot-bet-kecil/

https://copima.jp/latex/bet-100/

https://www.routlens.lu/app/themes/bet-100/

https://aws-klinkier.pl/wp-content/bet-100/

https://esigarauzmani.org/wp-includes/slot-bet-kecil/

https://www.bonus-new-member.albedonekretnine.hr/

slot bet 100

slot bet 100

slot bet 100

タイトルとURLをコピーしました