Text
in package
Text.
Table of Contents
Properties
- $controlCharacters : array<string|int, string>
- Control characters array.
Methods
- chr() : string
- controlCharacterOOXML2PHP() : string
- Convert from OpenXML escaped control character to PHP control character.
- controlCharacterPHP2OOXML() : string
- Convert from PHP control character to OpenXML escaped control character.
- isUTF8() : bool
- Check if a string contains UTF-8 data.
- numberFormat() : string
- Return a number formatted for being integrated in xml files.
- removeUnderscorePrefix() : string
- Return name without underscore for < 0.10.0 variable name compatibility.
- toUnicode() : string
- Returns unicode from UTF8 text.
- toUTF8() : string|null
- Return UTF8 encoded value.
- utf8ToUnicode() : array<string|int, mixed>
- Returns unicode array from UTF8 text.
- buildControlCharacters() : void
- Build control characters array.
- unicodeToEntities() : string
- Returns entites from unicode array.
Properties
$controlCharacters
Control characters array.
private
static array<string|int, string>
$controlCharacters
= []
Methods
chr()
public
static chr(int $dec) : string
Parameters
- $dec : int
Tags
Return values
stringcontrolCharacterOOXML2PHP()
Convert from OpenXML escaped control character to PHP control character.
public
static controlCharacterOOXML2PHP([string $value = '' ]) : string
Parameters
- $value : string = ''
-
Value to unescape
Return values
stringcontrolCharacterPHP2OOXML()
Convert from PHP control character to OpenXML escaped control character.
public
static controlCharacterPHP2OOXML([string $value = '' ]) : string
Excel 2007 team:
That's correct, control characters are stored directly in the shared-strings table.
We do encode characters that cannot be represented in XML using the following escape sequence:
xHHHH where H represents a hexadecimal character in the character's value...
So you could end up with something like x0008 in a string (either in a cell value (
Parameters
- $value : string = ''
-
Value to escape
Return values
stringisUTF8()
Check if a string contains UTF-8 data.
public
static isUTF8([string $value = '' ]) : bool
Parameters
- $value : string = ''
Return values
boolnumberFormat()
Return a number formatted for being integrated in xml files.
public
static numberFormat(float $number, int $decimals) : string
Parameters
- $number : float
- $decimals : int
Return values
stringremoveUnderscorePrefix()
Return name without underscore for < 0.10.0 variable name compatibility.
public
static removeUnderscorePrefix(string $value) : string
Parameters
- $value : string
Return values
stringtoUnicode()
Returns unicode from UTF8 text.
public
static toUnicode(string $text) : string
The function is splitted to reduce cyclomatic complexity
Parameters
- $text : string
-
UTF8 text
Tags
Return values
string —Unicode text
toUTF8()
Return UTF8 encoded value.
public
static toUTF8([null|string $value = '' ]) : string|null
Parameters
- $value : null|string = ''
Return values
string|nullutf8ToUnicode()
Returns unicode array from UTF8 text.
public
static utf8ToUnicode(string $text) : array<string|int, mixed>
Parameters
- $text : string
-
UTF8 text
Tags
Return values
array<string|int, mixed>buildControlCharacters()
Build control characters array.
private
static buildControlCharacters() : void
unicodeToEntities()
Returns entites from unicode array.
private
static unicodeToEntities(array<string|int, mixed> $unicode) : string
Parameters
- $unicode : array<string|int, mixed>