Download the PHP package lkt/tools without Composer
On this page you can find all versions of the php package lkt/tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tools
LKT Tools
Array tools
arrayAverage
Returns the AVG value from a numeric array
| Arg | Type | Description |
|---|---|---|
| $array | number[] | Input numbers |
Usage
arrayPushUnique
Push an item to an array if not exists yet
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
| $datum | any | Any datum to be added |
Usage
arrayKeyPushUnique
Adds a key to an array only if not defined yet
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
| $key | string | Array key |
| $datum | any | Any datum to be added |
Usage
arrayRemoveDatum
Finds data in an array and removes it.
If it's a numeric indexed array, it will reset indexes
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
| $datum | any | Any datum to be removed |
Usage
arrayValuesRecursive
Converts input array and array properties to one single array with all properties inside
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
Usage
arrayValuesRecursiveWithKeys
Same as arrayValuesRecursive but keeping a key structure
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
Usage
compareArrays
Compares two arrays and determine which keys were added and/or removed
| Arg | Type | Description |
|---|---|---|
| $array1 | any[] | Array |
| $array2 | any[] | Array |
Usage
getArrayFirstPosition
Returns the first element in an array no matter if it has numeric or string indexes
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
Usage
implodeWithAND
Implodes array elements with AND string
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
Usage
implodeWithOR
Implodes array elements with OR string
| Arg | Type | Description |
|---|---|---|
| $array | any[] | Array |
Usage
Color
decToHex
Converts a rgb color into hexadecimal string
| Arg | Type | Description |
|---|---|---|
| $color | [int, int int] | A 3 values array containing (red, green, blue) values |
Usage
hexToDec
Converts a hexadecimal color into rgb array
| Arg | Type | Description |
|---|---|---|
| $color | string | A valid hexadecimal string color |
Usage
Pagination
getTotalPages
Calculate the max number of pages
| Arg | Type | Description |
|---|---|---|
| $amountOfItems | int | Amount of elements to paginate |
| $itemsPerPage | int | Max elements shown per page |
Usage
Parse
clearInput
Sanitizes an input string
| Arg | Type | Description |
|---|---|---|
| $value | string | Datum |
Usage
removeDuplicatedWitheSpices
Removes all duplicated withe spaces and replace it with a single space
| Arg | Type | Description |
|---|---|---|
| $value | string | Datum |
Usage
All versions of tools with dependencies
ext-intl Version *
ext-xml Version *
ext-json Version *