(PHP 7, PHP 8)
IntlChar::charMirror — Guet the "mirror-imague" character for a code point
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.
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.
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) ")"
IntlChar::PROPERTY_BIDI_MIRRORED