Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
|
Static Public Member Functions | |
static | controlCharacterOOXML2PHP (string $textValue) |
Convert from OpenXML escaped control character to PHP control character. | |
static | controlCharacterPHP2OOXML (string $textValue) |
Convert from PHP control character to OpenXML escaped control character. | |
static | convertEncoding (string $textValue, string $to, string $from) |
Convert string from one encoding to another. | |
static | countCharacters (string $textValue, string $encoding='UTF-8') |
Get character count. | |
static | countCharactersDbcs (string $textValue, string $encoding='UTF-8') |
Get character count using mb_strwidth rather than mb_strlen. | |
static | formatNumber (float|int|string|null $numericValue) |
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. | |
static | getCurrencyCode (bool $trimAlt=false) |
Get the currency code. | |
static | getDecimalSeparator () |
Get the decimal separator. | |
static | getIsIconvEnabled () |
Get whether iconv extension is available. | |
static | getThousandsSeparator () |
Get the thousands separator. | |
static | isUTF8 (string $textValue) |
Check if a string contains UTF8 data. | |
static | mbIsUpper (string $character) |
static | mbStrSplit (string $string) |
Splits a UTF-8 string into an array of individual characters. | |
static | sanitizeUTF8 (string $textValue) |
Try to sanitize UTF8, replacing invalid sequences with Unicode substitution characters. | |
static | setCurrencyCode (?string $currencyCode) |
Set the currency code. | |
static | setDecimalSeparator (?string $separator) |
Set the decimal separator. | |
static | setThousandsSeparator (?string $separator) |
Set the thousands separator. | |
static | strCaseReverse (string $textValue) |
Reverse the case of a string, so that all uppercase characters become lowercase and all lowercase characters become uppercase. | |
static | strlenAllowNull (?string $string) |
static | strToLower (string $textValue) |
Convert a UTF-8 encoded string to lower case. | |
static | strToTitle (string $textValue) |
Convert a UTF-8 encoded string to title/proper case (uppercase every first character in each word, lower case all other characters). | |
static | strToUpper (string $textValue) |
Convert a UTF-8 encoded string to upper case. | |
static | substring (string $textValue, int $offset, ?int $length=0) |
Get a substring of a UTF-8 encoded string. | |
static | SYLKtoUTF8 (string $textValue) |
Convert SYLK encoded string to UTF-8. | |
static | testStringAsNumeric (string $textValue) |
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). | |
static | UTF8toBIFF8UnicodeLong (string $textValue) |
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. | |
static | UTF8toBIFF8UnicodeShort (string $textValue, array $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. | |
|
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 | $textValue | Value to unescape |
|
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 | $textValue | Value to escape |
|
static |
Convert string from one encoding to another.
string | $to | Encoding to convert to, e.g. 'UTF-8' |
string | $from | Encoding to convert from, e.g. 'UTF-16LE' |
|
static |
Get character count.
string | $encoding | Encoding |
int | Character count |
|
static |
Get character count using mb_strwidth rather than mb_strlen.
string | $encoding | Encoding |
int | Character count |
|
static |
Get the currency code.
If it has not yet been set explicitly, try to obtain the symbol information from locale.
|
static |
Get the decimal separator.
If it has not yet been set explicitly, try to obtain number formatting information from locale.
|
static |
Get the thousands separator.
If it has not yet been set explicitly, try to obtain number formatting information from locale.
|
static |
Set the currency code.
Only used by NumberFormat::toFormattedString() to format output by PhpOffice\PhpSpreadsheet\Writer\Html and PhpOffice\PhpSpreadsheet\Writer\Pdf.
?string | $currencyCode | Character for currency code |
|
static |
Set the decimal separator.
Only used by NumberFormat::toFormattedString() to format output by PhpOffice\PhpSpreadsheet\Writer\Html and PhpOffice\PhpSpreadsheet\Writer\Pdf.
?string | $separator | Character for decimal separator |
|
static |
Set the thousands separator.
Only used by NumberFormat::toFormattedString() to format output by PhpOffice\PhpSpreadsheet\Writer\Html and PhpOffice\PhpSpreadsheet\Writer\Pdf.
?string | $separator | Character for thousands separator |
|
static |
Reverse the case of a string, so that all uppercase characters become lowercase and all lowercase characters become uppercase.
string | $textValue | UTF-8 encoded string |
|
static |
Convert a UTF-8 encoded string to lower case.
string | $textValue | UTF-8 encoded string |
|
static |
Convert a UTF-8 encoded string to title/proper case (uppercase every first character in each word, lower case all other characters).
string | $textValue | UTF-8 encoded string |
|
static |
Convert a UTF-8 encoded string to upper case.
string | $textValue | UTF-8 encoded string |
|
static |
Get a substring of a UTF-8 encoded string.
string | $textValue | UTF-8 encoded string |
int | $offset | Start offset |
?int | $length | Maximum number of characters in substring |
|
static |
Convert SYLK encoded string to UTF-8.
string | $textValue | SYLK encoded string |
string | UTF-8 encoded string |
|
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).
float|string | string or only the leading numeric part of the string |
|
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 | $textValue | UTF-8 encoded string |
|
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 | $textValue | UTF-8 encoded string |
array<int,array{strlen | int, fontidx: int}> $arrcRuns Details of rich text runs in $value |