Table of contents
Namespace: Com\Tecnick\Unicode
File: Bidi.php line 48
Unicode Bidirectional Algorithm (UAX #9): reorders each paragraph of the input from logical to visual order and applies the Arabic shaping. https://www.unicode.org/reports/tr9/
Tags
- since: 2015-07-13
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2011-2026 Nicola Asuni - Tecnick.com LTD
- license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
- link: https://github.com/tecnickcom/tc-lib-unicode
Constants
CONTAINS_ARABIC
File: Bidi.php line 58
public mixed CONTAINS_ARABIC = 2
CONTAINS_FORMATTING
File: Bidi.php line 64
public mixed CONTAINS_FORMATTING = 4
CONTAINS_REMOVED
File: Bidi.php line 70
public mixed CONTAINS_REMOVED = 8
CONTAINS_RTL
File: Bidi.php line 53
public mixed CONTAINS_RTL = 1
Methods
__construct()
File: Bidi.php line 141
public __construct([string|null $str = null ][, array<string|int, string>|null $chrarr = null ][, array<string|int, int>|null $ordarr = null ][, string|TextDirection $forcedir = '' ][, bool $shaping = true ]) : mixed
Parameters
- $str : string|null = null: String to convert (if null it will be generated from $chrarr or $ordarr)
- $chrarr : array<string|int, string>|null = null: Array of UTF-8 chars (if empty it will be generated from $str or $ordarr)
- $ordarr : array<string|int, int>|null = null: Array of UTF-8 codepoints (if empty it will be generated from $str or $chrarr)
- $forcedir : string|TextDirection = ‘’: If ‘R’ forces RTL, if ‘L’ forces LTR (’’ auto), or a TextDirection case
- $shaping : bool = true: If true enable the shaping algorithm
Tags
- throws: Exception
getCharKeys()
File: Bidi.php line 303
public getCharKeys() : array<int, true>
Return values
array<int, true>
getChrArray()
File: Bidi.php line 265
public getChrArray() : array<string|int, string>
Tags
- throws: Exception
Return values
array<string|int, string>
getNumChars()
File: Bidi.php line 279
public getNumChars() : int
Tags
- throws: Exception
Return values
int
getOrdArray()
File: Bidi.php line 253
public getOrdArray() : array<string|int, int>
Return values
array<string|int, int>
getString()
File: Bidi.php line 289
public getString() : string
Tags
- throws: Exception
Return values
string