Home > Backend Development > PHP Tutorial > 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
Release: 2023-08-25 21:06:02
forward
668 people have browsed it

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

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

Syntax

int IntlChar::charDirection(val)
Copy after login

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

  • 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
  • < p>

  • 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>";
?>
Copy after login
###Output##### #The following is the output-###
int(3)
int(10)
NULL
int(0)
Copy after login
###

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template