PHP 8.3.4 Released!

IntlChar::istitle

(PHP 7, PHP 8)

IntlChar::istitleコードポイントがタイトルケース文字であるかを調べる

説明

public static IntlChar::istitle(int|string $codepoint): ?bool

コードポイントがタイトルケース文字であるかを判定します。

一般カテゴリ "Lt" (タイトルケース文字) である場合に、 true を返します。

パラメータ

codepoint

コードポイントを表す int 型の値 (例: U+2603 SNOWMAN を表す 0x2603)、あるいは UTF-8 文字列としてエンコードされた文字 (例: "\u{2603}")。

戻り値

codepoint がタイトルケース文字である場合に、 true を返します。 そうでない場合、false を返します。 失敗した場合は、null を返します。

例1 さまざまなコードポイントの例

<?php
// Latin Capital Letter Dz with Caron U+01C4
var_dump(IntlChar::istitle("DŽ"));
// Latin Capital Letter D with Small Letter Z with Caron U+01C5
var_dump(IntlChar::istitle("Dž"));
// Latin Small Letter Dz with Caron U+01C6
var_dump(IntlChar::istitle("dž"));

// Greek Capital Letter Alpha with Prosgegrammeni U+1FBC
var_dump(IntlChar::istitle("ᾼ"));
// Greek Small Letter Alpha with Ypogegrammeni U+1FB3
var_dump(IntlChar::istitle("ᾳ"));
// Greek Capital Letter Alpha U+0391
var_dump(IntlChar::istitle("Α"));
?>

上の例の出力は以下となります。

bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(false)

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top