Home  >  Article  >  Backend Development  >  In PHP, the IntlChar charDirection() function is used to return the direction attribute of a given character.

In PHP, the IntlChar charDirection() function is used to return the direction attribute of a given character.

WBOY
WBOYforward
2023-08-25 21:05:02609browse

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

IntlChar charDirection() function is used to display the bidirectional category value of the input value.

Syntax

int IntlChar::charDirection(val)

Parameters

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

Return

IntlChar charDirection() function returns the following bidirectional category value-

  • 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

  • #ain :: char_direction_non_spacing_mark

######################################################################## n EUTRAL ############# counter :: CHAR_DIRECTION_FIRST_S ############ 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############Example######The following is an example -###
<?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>";
?>
###Output##### #The following is the output-###
int(3)
int(10)
NULL
int(0)
###

The above is the detailed content of In PHP, the IntlChar charDirection() function is used to return the direction attribute of a given character.. 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