Convert
in package
Class providing variable type and value conversion functions.
Tags
Table of Contents
- debug() : void
- Displays a variable.
- get_arrow() : string|array<string|int, string>
- Get an HTML array short code depending on Arrow-Array key index.
- index() : string
- Converts an integer into the user-defined counter style for the footnotes.
- to_bool() : bool
- Converts a string depending on its value to a boolean.
- to_arabic_leading() : string
- Converts an integer to a leading-0 integer.
- to_latin() : string
- Converts an integer into Latin ASCII characters, either lower or upper-case.
- to_roman() : string
- Converts an integer to a Roman numeral.
Methods
debug()
Displays a variable.
public
static debug(mixed $p_mixed_value) : void
Parameters
- $p_mixed_value : mixed
-
The variable to display.
Tags
Return values
void —get_arrow()
Get an HTML array short code depending on Arrow-Array key index.
public
static get_arrow([int $index = -1 ]) : string|array<string|int, string>
Parameters
- $index : int = -1
-
Index representing the arrow. If empty, all arrows are specified.
Tags
Return values
string|array<string|int, string> —Array of all arrows if index is empty, otherwise HTML tag of a specific arrow.
index()
Converts an integer into the user-defined counter style for the footnotes.
public
static index(int $index[, string $convert_style = 'arabic_plain' ]) : string
Parameters
- $index : int
-
Index to be converted.
- $convert_style : string = 'arabic_plain'
-
Counter style to use.
Tags
Return values
string —The index converted to the defined counter style.
to_bool()
Converts a string depending on its value to a boolean.
public
static to_bool(string $value) : bool
Parameters
- $value : string
-
String to be converted to boolean.
Tags
Return values
bool —Boolean value represented by the string.
to_arabic_leading()
Converts an integer to a leading-0 integer.
private
static to_arabic_leading(int $value) : string
Parameters
- $value : int
-
Value to be converted.
Tags
Return values
string —Value with a leading zero.
to_latin()
Converts an integer into Latin ASCII characters, either lower or upper-case.
private
static to_latin(int $value, bool $upper_case) : string
This function works from values A–ZZ (meaning there is a limit of 676 gootnotes per Page).
Parameters
- $value : int
-
Value to be converted.
- $upper_case : bool
-
Whether to convert the value to upper-case.
Tags
Return values
string —to_roman()
Converts an integer to a Roman numeral.
private
static to_roman(int $value, bool $upper_case) : string
Parameters
- $value : int
-
Value to be converted.
- $upper_case : bool
-
Whether to convert the value to upper-case.