Documentation

Utils
in package

Utils class.

Tags
copyright

YetiForce S.A.

license

YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)

author

Mariusz Krzaczkowski m.krzaczkowski@yetiforce.com

Table of Contents

changeSequence()  : array<string|int, mixed>
Change the order of associative array.
convertCharacterEncoding()  : string
Convert string from encoding to encoding.
flatten()  : array<string|int, mixed>
Flatten a multi-dimensional array into a single level.
flattenKeys()  : array<string|int, mixed>
Flatten the multidimensional array on one level, keeping the key names unique.
getInitials()  : string
Function to capture the initial letters of words.
getLocksContent()  : string
Get locks content by events.
htmlToText()  : string
Strip tags content.
isAssoc()  : bool
Check if array is associative.
isHtml()  : bool
Function to check is a html message.
mbUcfirst()  : string
Replacement for the ucfirst function for proper Multibyte String operation.
merge()  : array<string|int, mixed>
Merge two arrays.
sanitizeSpecialChars()  : string
Sanitize special chars from given string.
saveToFile()  : bool
Function to save php file with cleaning file cache.
varExport()  : mixed
Outputs or returns a parsable string representation of a variable.

Methods

changeSequence()

Change the order of associative array.

public static changeSequence(array<string|int, mixed> $array, array<string|int, mixed> $order) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$order : array<string|int, mixed>
Return values
array<string|int, mixed>

convertCharacterEncoding()

Convert string from encoding to encoding.

public static convertCharacterEncoding(string $value, string $fromCharset, string $toCharset) : string
Parameters
$value : string
$fromCharset : string
$toCharset : string
Return values
string

flatten()

Flatten a multi-dimensional array into a single level.

public static flatten(array<string|int, mixed> $array[, float $depth = INF ]) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$depth : float = INF
Return values
array<string|int, mixed>

flattenKeys()

Flatten the multidimensional array on one level, keeping the key names unique.

public static flattenKeys(array<string|int, mixed> $array[, string $type = '_' ][, float $depth = INF ]) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$type : string = '_'
$depth : float = INF
Return values
array<string|int, mixed>

getInitials()

Function to capture the initial letters of words.

public static getInitials(string $name) : string
Parameters
$name : string
Return values
string

getLocksContent()

Get locks content by events.

public static getLocksContent(array<string|int, mixed> $locks) : string
Parameters
$locks : array<string|int, mixed>
Return values
string

htmlToText()

Strip tags content.

public static htmlToText(string $content) : string
Parameters
$content : string
Return values
string

isAssoc()

Check if array is associative.

public static isAssoc(array<string|int, mixed> $arr) : bool
Parameters
$arr : array<string|int, mixed>
Return values
bool

isHtml()

Function to check is a html message.

public static isHtml(string $content) : bool
Parameters
$content : string
Return values
bool

mbUcfirst()

Replacement for the ucfirst function for proper Multibyte String operation.

public static mbUcfirst(string $string) : string

Delete function will exist as mb_ucfirst.

Parameters
$string : string
Return values
string

merge()

Merge two arrays.

public static merge(array<string|int, mixed> $array1, array<string|int, mixed> $array2) : array<string|int, mixed>
Parameters
$array1 : array<string|int, mixed>
$array2 : array<string|int, mixed>
Return values
array<string|int, mixed>

sanitizeSpecialChars()

Sanitize special chars from given string.

public static sanitizeSpecialChars(string $string[, string $delimiter = '_' ]) : string
Parameters
$string : string
$delimiter : string = '_'
Return values
string

saveToFile()

Function to save php file with cleaning file cache.

public static saveToFile(string $pathDirectory, array<string|int, mixed>|string $content[, string $comment = '' ][, int $flag = LOCK_EX ][, bool $return = false ]) : bool
Parameters
$pathDirectory : string
$content : array<string|int, mixed>|string
$comment : string = ''
$flag : int = LOCK_EX
$return : bool = false
Return values
bool

$value

varExport()

Outputs or returns a parsable string representation of a variable.

public static varExport(mixed $variable) : mixed
Parameters
$variable : mixed
Tags
see
https://php.net/manual/en/function.var-export.php
Return values
mixed

the variable representation when the return


        

Search results