\PhpOffice\CommonText

Text

Summary

Methods
Properties
Constants
controlCharacterPHP2OOXML()
numberFormat()
chr()
controlCharacterOOXML2PHP()
isUTF8()
toUTF8()
toUnicode()
utf8ToUnicode()
removeUnderscorePrefix()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
buildControlCharacters()
unicodeToEntities()
$controlCharacters
N/A

Properties

$controlCharacters

$controlCharacters : array<mixed,string>

Control characters array

Type

array<mixed,string>

Methods

controlCharacterPHP2OOXML()

controlCharacterPHP2OOXML(string  $value = '') : string

Convert from PHP control character to OpenXML escaped control character

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

string $value

Value to escape

Returns

string

numberFormat()

numberFormat(float  $number, integer  $decimals) 

Return a number formatted for being integrated in xml files

Parameters

float $number
integer $decimals

chr()

chr(integer  $dec) 

Parameters

integer $dec

controlCharacterOOXML2PHP()

controlCharacterOOXML2PHP(string  $value = '') : string

Convert from OpenXML escaped control character to PHP control character

Parameters

string $value

Value to unescape

Returns

string

isUTF8()

isUTF8(string  $value = '') : boolean

Check if a string contains UTF-8 data

Parameters

string $value

Returns

boolean

toUTF8()

toUTF8(string  $value = '') : string

Return UTF8 encoded value

Parameters

string $value

Returns

string

toUnicode()

toUnicode(string  $text) : string

Returns unicode from UTF8 text

The function is splitted to reduce cyclomatic complexity

Parameters

string $text

UTF8 text

Returns

string —

Unicode text

utf8ToUnicode()

utf8ToUnicode(string  $text) : array

Returns unicode array from UTF8 text

Parameters

string $text

UTF8 text

Returns

array

removeUnderscorePrefix()

removeUnderscorePrefix(string  $value) : string

Return name without underscore for < 0.10.0 variable name compatibility

Parameters

string $value

Returns

string

buildControlCharacters()

buildControlCharacters() 

Build control characters array

unicodeToEntities()

unicodeToEntities(array  $unicode) : string

Returns entites from unicode array

Parameters

array $unicode

Returns

string