Rumah >pembangunan bahagian belakang >tutorial php >Dalam PHP, fungsi IntlChar charDirection() digunakan untuk mengembalikan atribut arah bagi aksara yang diberikan.

Dalam PHP, fungsi IntlChar charDirection() digunakan untuk mengembalikan atribut arah bagi aksara yang diberikan.

WBOY
WBOYke hadapan
2023-08-25 21:05:02625semak imbas

在PHP中,IntlChar charDirection()函数的作用是返回给定字符的方向属性

IntlChar charDirection() 函数用于显示输入值的双向类别值。

语法

int IntlChar::charDirection(val)

参数

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

返回

IntlChar charDirection() 函数返回以下双向类别值 -

  • IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT

    li>
  • IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT

  • IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER

  • IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR p>

  • 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
   var_dump(IntlChar::charDirection("-"));
   echo "<br>";
   var_dump(IntlChar::charDirection("*"));
   echo "<br>";
   var_dump(IntlChar::charDirection("kjh"));
   echo "<br>";
   var_dump(IntlChar::charDirection("H"));
   echo "<br>";
?>

输出

以下是输出 -

int(3)
int(10)
NULL
int(0)

Atas ialah kandungan terperinci Dalam PHP, fungsi IntlChar charDirection() digunakan untuk mengembalikan atribut arah bagi aksara yang diberikan.. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Kenyataan:
Artikel ini dikembalikan pada:tutorialspoint.com. Jika ada pelanggaran, sila hubungi admin@php.cn Padam