首页  >  文章  >  Java  >  在PHP中,IntlChar getBlockCode()函数的翻译如下:

在PHP中,IntlChar getBlockCode()函数的翻译如下:

WBOY
WBOY转载
2023-08-29 13:13:021061浏览

在PHP中,IntlChar getBlockCode()函数的翻译如下:

The IntlChar getBlockCode() function is used to get the Unicode allocation block containing the value val.

Syntax

IntlChar::getBlockCode (val)

参数

  • val - 一个作为UTF-8字符串编码的整数或字符。

返回值

IntlChar getBlockCode()函数返回val的块值。以下是列表 -

  • IntlChar::BLOCK_CODE_BASIC_LATIN

  • IntlChar::BLOCK_CODE_GREEK

  • IntlChar::BLOCK_CODE_MISCELLANEOUS_SYMBOLS

示例

以下是一个示例 -

<?php
   var_dump(IntlChar::getBlockCode("A") === IntlChar::BLOCK_CODE_BASIC_LATIN);
   echo "<br>";
   var_dump(IntlChar::getBlockCode("PQRS") === IntlChar::BLOCK_CODE_BASIC_LATIN);
   echo "<br>";
   var_dump(IntlChar::getBlockCode("u{2603}") === IntlChar::BLOCK_CODE_MISCELLANEOUS_SYMBOLS);
?>

输出

以下是输出 −

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

以上是在PHP中,IntlChar getBlockCode()函数的翻译如下:的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:tutorialspoint.com。如有侵权,请联系admin@php.cn删除