Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 676 lines (20 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TextData:: (26 methods):
  unicodeToOrd()
  CHARACTER()
  TRIMNONPRINTABLE()
  TRIMSPACES()
  convertBooleanValue()
  ASCIICODE()
  CONCATENATE()
  DOLLAR()
  SEARCHSENSITIVE()
  SEARCHINSENSITIVE()
  FIXEDFORMAT()
  LEFT()
  MID()
  RIGHT()
  STRINGLENGTH()
  LOWERCASE()
  UPPERCASE()
  PROPERCASE()
  REPLACE()
  SUBSTITUTE()
  RETURNSTRING()
  TEXTFORMAT()
  VALUE()
  NUMBERVALUE()
  EXACT()
  TEXTJOIN()


Class: TextData  - X-Ref

unicodeToOrd($character)   X-Ref
No description

CHARACTER($character)   X-Ref
CHARACTER.

param: string $character Value
return: string

TRIMNONPRINTABLE($stringValue = '')   X-Ref
TRIMNONPRINTABLE.

param: mixed $stringValue Value to check
return: string

TRIMSPACES($stringValue = '')   X-Ref
TRIMSPACES.

param: mixed $stringValue Value to check
return: string

convertBooleanValue($value)   X-Ref
No description

ASCIICODE($characters)   X-Ref
ASCIICODE.

param: string $characters Value
return: int|string A string if arguments are invalid

CONCATENATE(...$args)   X-Ref
CONCATENATE.

return: string

DOLLAR($value = 0, $decimals = 2)   X-Ref
DOLLAR.

This function converts a number to text using currency format, with the decimals rounded to the specified place.
The format used is $#,##0.00_);($#,##0.00)..

param: float $value The value to format
param: int $decimals The number of digits to display to the right of the decimal point.
return: string

SEARCHSENSITIVE($needle, $haystack, $offset = 1)   X-Ref
SEARCHSENSITIVE.

param: string $needle The string to look for
param: string $haystack The string in which to look
param: int $offset Offset within $haystack
return: string

SEARCHINSENSITIVE($needle, $haystack, $offset = 1)   X-Ref
SEARCHINSENSITIVE.

param: string $needle The string to look for
param: string $haystack The string in which to look
param: int $offset Offset within $haystack
return: string

FIXEDFORMAT($value, $decimals = 2, $no_commas = false)   X-Ref
FIXEDFORMAT.

param: mixed $value Value to check
param: int $decimals
param: bool $no_commas
return: string

LEFT($value = '', $chars = 1)   X-Ref
LEFT.

param: string $value Value
param: int $chars Number of characters
return: string

MID($value = '', $start = 1, $chars = null)   X-Ref
MID.

param: string $value Value
param: int $start Start character
param: int $chars Number of characters
return: string

RIGHT($value = '', $chars = 1)   X-Ref
RIGHT.

param: string $value Value
param: int $chars Number of characters
return: string

STRINGLENGTH($value = '')   X-Ref
STRINGLENGTH.

param: string $value Value
return: int

LOWERCASE($mixedCaseString)   X-Ref
LOWERCASE.

Converts a string value to upper case.

param: string $mixedCaseString
return: string

UPPERCASE($mixedCaseString)   X-Ref
UPPERCASE.

Converts a string value to upper case.

param: string $mixedCaseString
return: string

PROPERCASE($mixedCaseString)   X-Ref
PROPERCASE.

Converts a string value to upper case.

param: string $mixedCaseString
return: string

REPLACE($oldText, $start, $chars, $newText)   X-Ref
REPLACE.

param: string $oldText String to modify
param: int $start Start character
param: int $chars Number of characters
param: string $newText String to replace in defined position
return: string

SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0)   X-Ref
SUBSTITUTE.

param: string $text Value
param: string $fromText From Value
param: string $toText To Value
param: int $instance Instance Number
return: string

RETURNSTRING($testValue = '')   X-Ref
RETURNSTRING.

param: mixed $testValue Value to check
return: null|string

TEXTFORMAT($value, $format)   X-Ref
TEXTFORMAT.

param: mixed $value Value to check
param: string $format Format mask to use
return: string

VALUE($value = '')   X-Ref
VALUE.

param: mixed $value Value to check
return: DateTimeInterface|float|int|string A string if arguments are invalid

NUMBERVALUE($value = '', $decimalSeparator = null, $groupSeparator = null)   X-Ref
No description

EXACT($value1, $value2)   X-Ref
Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.
EXACT is case-sensitive but ignores formatting differences.
Use EXACT to test text being entered into a document.

param: $value1
param: $value2
return: bool

TEXTJOIN($delimiter, $ignoreEmpty, ...$args)   X-Ref
TEXTJOIN.

param: mixed $delimiter
param: mixed $ignoreEmpty
param: mixed $args
return: string