(PHP 7, PHP 8)
IntlChar::getBlockCode — 获取包含代码点的 Unicode 分配块
返回 codepoint 的块值。有关可能的返回值,请参阅 IntlChar::BLOCK_CODE_* 常量。失败时返回 null。
示例 #1 测试不同的代码点
<?php
var_dump(IntlChar::getBlockCode("A") === IntlChar::BLOCK_CODE_BASIC_LATIN);
var_dump(IntlChar::getBlockCode("Φ") === IntlChar::BLOCK_CODE_GREEK);
var_dump(IntlChar::getBlockCode("\u{2603}") === IntlChar::BLOCK_CODE_MISCELLANEOUS_SYMBOLS);
?>以上示例将输出
bool(true) bool(true) bool(true)