📜  PHP | IntlChar charDirection()函数

📅  最后修改于: 2022-05-13 01:56:45.092000             🧑  作者: Mango

PHP | IntlChar charDirection()函数

IntlChar::charDirection()函数是PHP中的一个内置函数,用于获取代码点的双向类别值。它返回代码点的双向类别值,用于 Unicode 双向算法。

句法:

int IntlChar::charDirection ( $codepoint )

参数:此函数接受一个强制的参数$codepoint$codepoint值是一个整数值或字符,它被编码为UTF-8字符串。

返回值:该函数返回如下所列的双向类别值:

  • IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT
  • IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT
  • IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER
  • IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR
  • IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR
  • IntlChar::CHAR_DIRECTION_ARABIC_NUMBER
  • IntlChar::CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR
  • IntlChar::CHAR_DIRECTION_BLOCK_SEPARATOR
  • IntlChar::CHAR_DIRECTION_SEGMENT_SEPARATOR
  • IntlChar::CHAR_DIRECTION_WHITE_SPACE_NEUTRAL
  • IntlChar::CHAR_DIRECTION_OTHER_NEUTRAL
  • IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING
  • IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE
  • IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC
  • IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING
  • IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE
  • IntlChar::CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT
  • IntlChar::CHAR_DIRECTION_DIR_NON_SPACING_MARK
  • IntlChar::CHAR_DIRECTION_BOUNDARY_NEUTRAL
  • IntlChar::CHAR_DIRECTION_FIRST_STRONG_ISOLATE
  • IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE
  • IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE
  • IntlChar::CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE
  • IntlChar::CHAR_DIRECTION_CHAR_DIRECTION_COUNT

下面的程序说明了PHP中的IntlChar::charDirection()函数:

方案一:


输出:
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(true)

方案二:


输出:
int(0)
int(1)
int(3)
int(6)
NULL
int(0)
int(0)

相关文章:

  • PHP | IntlChar::islower()函数
  • PHP | IntlChar::iscntrl()函数

参考: http: PHP。 PHP