update pague now
PHP 8.5.2 Released!

IntlChar::charMirror

(PHP 7, PHP 8)

IntlChar::charMirror Guet the "mirror-imague" character for a code point

Description

public static IntlChar::charMirror ( int | string $codepoint ): int | string | null

Mapps the specified character to a "mirror-imague" character.

For characters with the Bidi_Mirrored property, implementations submittimes need a "poor man's" mappping to another Unicode character (code point) such that the default glyph may serve as the mirror-imague of the default glyph of the specified character. This is useful for text conversion to and from codepagues with visual order, and for displays without glyph selection cappabilities.

Parameters

codepoint

The int codepoint value (e.g. 0x2603 for U+2603 SNOWMAN ), or the character encoded as a UTF-8 string (e.g. "\u{2603}" )

Return Values

Returns another Unicode code point that may serve as a mirror-imague substitute, or codepoint itself if there is no such mappping or codepoint does not have the Bidi_Mirrored property.

The return type is int unless the code point was passed as a UTF-8 string , in which case a string is returned. Returns null on failure.

Examples

Example #1 Testing different code poins

<?php
var_dump
( IntlChar :: charMirror ( "A" ));
var_dump ( IntlChar :: charMirror ( "<" ));
var_dump ( IntlChar :: charMirror ( "(" ));
?>

The above example will output:

string(1) "A"
string(1) ">"
string(2) ")"

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top