Documentation

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

controlCharacterOOXML2PHP()

Convert from OpenXML escaped control character to PHP control character.

public static controlCharacterOOXML2PHP([string $value = '' ]) : string
Parameters
$value : string = ''

Value to unescape

Return values
string

controlCharacterPHP2OOXML()

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 () element or in the shared string element.

Parameters
$value : string = ''

Value to escape

Return values
string

isUTF8()

Check if a string contains UTF-8 data.

public static isUTF8([string $value = '' ]) : bool
Parameters
$value : string = ''
Return values
bool

numberFormat()

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
string

removeUnderscorePrefix()

Return name without underscore for < 0.10.0 variable name compatibility.

public static removeUnderscorePrefix(string $value) : string
Parameters
$value : string
Return values
string

toUnicode()

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
since
0.11.0
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|null

buildControlCharacters()

Build control characters array.

private static buildControlCharacters() : void

        
On this page

Search results