Home  >  Article  >  Java  >  In PHP, the translation of the IntlChar getBlockCode() function is as follows:

In PHP, the translation of the IntlChar getBlockCode() function is as follows:

WBOY
WBOYforward
2023-08-29 13:13:021062browse

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

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

Syntax

IntlChar::getBlockCode (val)

Parameters

  • val - An integer or character encoded as a UTF-8 string.

Return value

IntlChar getBlockCode() function returns the block value of val. Here is the list -

  • IntlChar::BLOCK_CODE_BASIC_LATIN

  • IntlChar::BLOCK_CODE_GREEK

  • IntlChar: :BLOCK_CODE_MISCELLANEOUS_SYMBOLS

##Example

The following is an example-

<?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);
?>

Output

The following is the output-

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

The above is the detailed content of In PHP, the translation of the IntlChar getBlockCode() function is as follows:. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete