ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Static Public Member Functions | |
static | getIsIconvEnabled () |
Get whether iconv extension is available. More... | |
static | controlCharacterOOXML2PHP ($value) |
Convert from OpenXML escaped control character to PHP control character. More... | |
static | controlCharacterPHP2OOXML ($value) |
Convert from PHP control character to OpenXML escaped control character. More... | |
static | sanitizeUTF8 ($value) |
Try to sanitize UTF8, stripping invalid byte sequences. More... | |
static | isUTF8 ($value) |
Check if a string contains UTF8 data. More... | |
static | formatNumber ($value) |
Formats a numeric value as a string for output in various output writers forcing point as decimal separator in case locale is other than English. More... | |
static | UTF8toBIFF8UnicodeShort ($value, $arrcRuns=[]) |
Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. More... | |
static | UTF8toBIFF8UnicodeLong ($value) |
Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. More... | |
static | convertEncoding ($value, $to, $from) |
Convert string from one encoding to another. More... | |
static | countCharacters ($value, $enc='UTF-8') |
Get character count. More... | |
static | substring ($pValue, $pStart, $pLength=0) |
Get a substring of a UTF-8 encoded string. More... | |
static | strToUpper ($pValue) |
Convert a UTF-8 encoded string to upper case. More... | |
static | strToLower ($pValue) |
Convert a UTF-8 encoded string to lower case. More... | |
static | strToTitle ($pValue) |
Convert a UTF-8 encoded string to title/proper case (uppercase every first character in each word, lower case all other characters). More... | |
static | mbIsUpper ($char) |
static | mbStrSplit ($string) |
static | strCaseReverse ($pValue) |
Reverse the case of a string, so that all uppercase characters become lowercase and all lowercase characters become uppercase. More... | |
static | convertToNumberIfFraction (&$operand) |
Identify whether a string contains a fractional numeric value, and convert it to a numeric if it is. More... | |
static | getDecimalSeparator () |
Get the decimal separator. More... | |
static | setDecimalSeparator ($pValue) |
Set the decimal separator. More... | |
static | getThousandsSeparator () |
Get the thousands separator. More... | |
static | setThousandsSeparator ($pValue) |
Set the thousands separator. More... | |
static | getCurrencyCode () |
Get the currency code. More... | |
static | setCurrencyCode ($pValue) |
Set the currency code. More... | |
static | SYLKtoUTF8 ($pValue) |
Convert SYLK encoded string to UTF-8. More... | |
static | testStringAsNumeric ($value) |
Retrieve any leading numeric part of a string, or return the full string if no leading numeric (handles basic integer or float, but not exponent or non decimal). More... | |
Data Fields | |
const | STRING_REGEXP_FRACTION = '(-?)(\d+)\s+(\d+\/\d+)' |
Constants. More... | |
Static Private Member Functions | |
static | buildControlCharacters () |
Build control characters array. More... | |
static | buildSYLKCharacters () |
Build SYLK characters array. More... | |
static | buildCharacterSets () |
Static Private Attributes | |
static | $controlCharacters = [] |
static | $SYLKCharacters = [] |
static | $decimalSeparator |
static | $thousandsSeparator |
static | $currencyCode |
static | $isIconvEnabled |
static | $iconvOptions = '//IGNORE//TRANSLIT' |
Definition at line 7 of file StringHelper.php.
|
staticprivate |
Definition at line 275 of file StringHelper.php.
|
staticprivate |
|
staticprivate |
|
static |
Convert from OpenXML escaped control character to PHP control character.
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 (<v>) element or in the shared string <t> element.
string | $value | Value to unescape |
Definition at line 301 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Reader\Xlsx\getFromZipArchive(), and PhpOffice\PhpSpreadsheet\Reader\Xlsx\readStyle().
|
static |
Convert from PHP control character to OpenXML escaped control character.
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 (<v>) element or in the shared string <t> element.
string | $value | Value to escape |
Definition at line 323 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Xlsx\Chart\writeCategoryAxis(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet\writeCellInlineStr(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\StringTable\writeRichText(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\StringTable\writeRichTextForCharts(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\StringTable\writeStringTable(), and PhpOffice\PhpSpreadsheet\Writer\Xlsx\Chart\writeValueAxis().
|
static |
Convert string from one encoding to another.
string | $value | |
string | $to | Encoding to convert to, e.g. 'UTF-8' |
string | $from | Encoding to convert from, e.g. 'UTF-16LE' |
Definition at line 445 of file StringHelper.php.
References $from, and $result.
Referenced by PhpOffice\PhpSpreadsheet\Reader\Xml\canRead(), PhpOffice\PhpSpreadsheet\Reader\Xls\decodeCodepage(), PhpOffice\PhpSpreadsheet\Reader\Xls\encodeUTF16(), PhpOffice\PhpSpreadsheet\Reader\Csv\openFileOrMemory(), PhpOffice\PhpSpreadsheet\Reader\Xls\readDocumentSummaryInformation(), PhpOffice\PhpSpreadsheet\Reader\Xls\readSummaryInformation(), and PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeUrlInternal().
|
static |
Identify whether a string contains a fractional numeric value, and convert it to a numeric if it is.
string | $operand | string value to test |
Definition at line 563 of file StringHelper.php.
References PhpOffice\PhpSpreadsheet\Calculation\Calculation\getInstance().
Referenced by PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\arrayRightDivide(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\arrayTimesEquals(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\minusEquals(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\plusEquals(), PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix\power(), and PhpOffice\PhpSpreadsheet\Calculation\Calculation\validateBinaryOperand().
|
static |
Get character count.
string | $value | |
string | $enc | Encoding |
Definition at line 465 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\__construct(), PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\checkSheetCodeName(), PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\checkSheetTitle(), PhpOffice\PhpSpreadsheet\Shared\Font\getTextWidthPixelsApprox(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Search\insensitive(), PhpOffice\PhpSpreadsheet\Reader\Xls\readLabelSst(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Search\sensitive(), PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\setCodeName(), PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\setTitle(), PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook\writeDefinedNameBiff8(), and PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeUrlInternal().
|
static |
Formats a numeric value as a string for output in various output writers forcing point as decimal separator in case locale is other than English.
mixed | $value |
Definition at line 370 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Html\generatePageDeclarations(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet\writeCellFormula(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet\writeCols(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\Style\writeFont(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet\writePageMargins(), PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet\writeSheetData(), and PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet\writeSheetFormatPr().
|
static |
Get the currency code.
If it has not yet been set explicitly, try to obtain the symbol information from locale.
Definition at line 650 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\bindValue(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\NumberFormatter\format(), and PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\VALUE().
|
static |
Get the decimal separator.
If it has not yet been set explicitly, try to obtain number formatting information from locale.
Definition at line 584 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\bindValue(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\FIXEDFORMAT(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\NumberFormatter\formatStraightNumericValue(), and PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\NUMBERVALUE().
|
static |
Get whether iconv extension is available.
Definition at line 247 of file StringHelper.php.
|
static |
Get the thousands separator.
If it has not yet been set explicitly, try to obtain number formatting information from locale.
Definition at line 617 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\bindValue(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\FIXEDFORMAT(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\NumberFormatter\formatStraightNumericValue(), PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\NUMBERVALUE(), and PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\VALUE().
|
static |
Check if a string contains UTF8 data.
string | $value |
Definition at line 357 of file StringHelper.php.
|
static |
Definition at line 521 of file StringHelper.php.
|
static |
Definition at line 526 of file StringHelper.php.
|
static |
Try to sanitize UTF8, stripping invalid byte sequences.
Not perfect. Does not surrogate characters.
string | $value |
Definition at line 337 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Cell\StringValueBinder\bindValue(), PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder\bindValue(), and PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\bindValue().
|
static |
Set the currency code.
Only used by NumberFormat::toFormattedString() to format output by and .
string | $pValue | Character for currency code |
Definition at line 677 of file StringHelper.php.
|
static |
Set the decimal separator.
Only used by NumberFormat::toFormattedString() to format output by and .
string | $pValue | Character for decimal separator |
Definition at line 606 of file StringHelper.php.
|
static |
Set the thousands separator.
Only used by NumberFormat::toFormattedString() to format output by and .
string | $pValue | Character for thousands separator |
Definition at line 639 of file StringHelper.php.
|
static |
Reverse the case of a string, so that all uppercase characters become lowercase and all lowercase characters become uppercase.
string | $pValue | UTF-8 encoded string |
Definition at line 541 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Calculation\Calculation\strcmpLowercaseFirst().
|
static |
Convert a UTF-8 encoded string to lower case.
string | $pValue | UTF-8 encoded string |
Definition at line 503 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Calculation\LookupRef\HLookup\hLookupSearch(), PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert\lower(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\MATCH(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch\prepareLookupArray(), PhpOffice\PhpSpreadsheet\Calculation\LookupRef\VLookup\vLookupSearch(), and PhpOffice\PhpSpreadsheet\Calculation\LookupRef\VLookup\vlookupSort().
|
static |
Convert a UTF-8 encoded string to title/proper case (uppercase every first character in each word, lower case all other characters).
string | $pValue | UTF-8 encoded string |
Definition at line 516 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert\proper().
|
static |
Convert a UTF-8 encoded string to upper case.
string | $pValue | UTF-8 encoded string |
Definition at line 491 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Spreadsheet\addDefinedName(), PhpOffice\PhpSpreadsheet\Calculation\Calculation\executeBinaryComparisonOperation(), PhpOffice\PhpSpreadsheet\Spreadsheet\getDefinedName(), PhpOffice\PhpSpreadsheet\Spreadsheet\getNamedFormula(), PhpOffice\PhpSpreadsheet\Spreadsheet\getNamedRange(), PhpOffice\PhpSpreadsheet\Spreadsheet\removeDefinedName(), and PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert\upper().
|
static |
Get a substring of a UTF-8 encoded string.
string | $pValue | UTF-8 encoded string |
int | $pStart | Start offset |
int | $pLength | Maximum number of characters in substring |
Definition at line 479 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\checkSheetCodeName(), PhpOffice\PhpSpreadsheet\Cell\DataType\checkString(), PhpOffice\PhpSpreadsheet\Reader\Xls\readLabelSst(), PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\setCodeName(), and PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\setTitle().
|
static |
Convert SYLK encoded string to UTF-8.
string | $pValue |
Definition at line 689 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Reader\Slk\listWorksheetInfo(), and PhpOffice\PhpSpreadsheet\Reader\Slk\loadIntoExisting().
|
static |
Retrieve any leading numeric part of a string, or return the full string if no leading numeric (handles basic integer or float, but not exponent or non decimal).
string | $value |
Definition at line 713 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getDay(), PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getMonth(), and PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Date\getYear().
|
static |
Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect.
2.5.3.
string | $value | UTF-8 encoded string |
Definition at line 425 of file StringHelper.php.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeCFRule(), PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeDataValidity(), PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook\writeDefinedNameBiff8(), PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeFooter(), PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeHeader(), PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeLabelSst(), PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook\writeNumberFormat(), PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeRangeProtection(), and PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeStringRecord().
|
static |
Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect.
2.5.3.
string | $value | UTF-8 encoded string |
mixed[] | $arrcRuns Details of rich text runs in $value |
Definition at line 391 of file StringHelper.php.
References $data.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook\calcSheetOffsets(), PhpOffice\PhpSpreadsheet\Writer\Xls\Parser\convertString(), PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook\writeBoundSheet(), PhpOffice\PhpSpreadsheet\Writer\Xls\Font\writeFont(), and PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeRichTextString().
|
staticprivate |
Definition at line 19 of file StringHelper.php.
|
staticprivate |
Definition at line 47 of file StringHelper.php.
|
staticprivate |
Definition at line 33 of file StringHelper.php.
|
staticprivate |
Definition at line 61 of file StringHelper.php.
|
staticprivate |
Definition at line 54 of file StringHelper.php.
|
staticprivate |
Definition at line 26 of file StringHelper.php.
|
staticprivate |
Definition at line 40 of file StringHelper.php.
const PhpOffice\PhpSpreadsheet\Shared\StringHelper::STRING_REGEXP_FRACTION = '(-?)(\d+)\s+(\d+\/\d+)' |