inc\classes\funcs.php
Data manipulating universal functions
- Author
- Sergey Dilong
- License
- GPL-2.0
- Package
- Temply-Account\Core
\funcs
A set of function to transform/check/etc data
- Author
- Sergey Dilong
- License
- GPL-2.0
Methods

arrInArr(array $a) : arrayArrays in array
Get all subarrays in array
arrInArr([1,[2,3],4,[5],6,[7,[89]]]) => [[2,3],[5],[7,[89]]]
| Name | Type | Description |
|---|---|---|
| $a | array | Input array |
| Type | Description |
|---|---|
| array | Subarrays |

exp(string $d, boolean $e = false) : arrayExplode
Turn string to array
TF1: |1||4||6| => [1, 4, 6]
TF2: |a::1||b::4||c::6| => ["a" => 1, "b" => 4, "c" => 6]
| Name | Type | Description |
|---|---|---|
| $d | string | Input string |
| $e | boolean | Enabe TF2 mode (if |
| Type | Description |
|---|---|
| array | Result. Also it could be False if it's unexplodable string |

giveArray(array $a, string $k) : mixed | booleanGet array key
Gets an array key from an array
| Name | Type | Description |
|---|---|---|
| $a | array | Requested array |
| $k | string | Key |
| Type | Description |
|---|---|
| mixed | boolean | `false` If doesn't exist |
- Deprecated

imp(array $d, boolean $e = false) : stringImplode
Turn array to string
TF1: [1, 4, 6] => |1||4||6|
TF2: ["a" => 1, "b" => 4, "c" => 6] => |a::1||b::4||c::6|
| Name | Type | Description |
|---|---|---|
| $d | array | Input array |
| $e | boolean | Enable TF2 mode |
| Type | Description |
|---|---|
| string | Result |

is_in_array(array $array, string $key, string $key_value) : booleanIs In Array
Recursively checks array for [key => value] pair existance
| Name | Type | Description |
|---|---|---|
| $array | array | Array to check |
| $key | string | Key name |
| $key_value | string | Pair's value |
| Type | Description |
|---|---|
| boolean | If `true` - there is such pair |

recursive_unset(array $array, string $unwanted_key) : voidRecursive Unset
Remove key from array and all subarrays
Warning: This function changes given variable directly and doesn't return anything
| Name | Type | Description |
|---|---|---|
| $array | array | Array to modify |
| $unwanted_key | string | Key name to remove |

strCheck(string $q, array $o) : booleanString Checks
Checks string by parameters
| Name | Type | Description |
|---|---|---|
| $q | string | String to check |
| $o | array | Check settings
|
| Type | Description |
|---|---|
| boolean | If `true` - correct |