Ka Extensions

Arrays
in component

Helpful functions for managing arrays

Table of Contents

Methods

fillObject()  : mixed
inArray()  : mixed
Searches for the specified value by the key in an array of arrays.
insertAfterKey()  : mixed
Service function, helps to insert an array inside another array after a specific key
insertBeforeKey()  : mixed

Methods

fillObject()

public static fillObject(mixed $obj, mixed $array) : mixed
Parameters
$obj : mixed
$array : mixed

inArray()

Searches for the specified value by the key in an array of arrays.

public static inArray(mixed $value, mixed $array, mixed $key) : mixed

Returns true when the value is found or false when it is not found.

Parameters
$value : mixed
$array : mixed
$key : mixed

insertAfterKey()

Service function, helps to insert an array inside another array after a specific key

public static insertAfterKey(mixed $array, mixed $key, mixed $value) : mixed

Returns a new array

Parameters
$array : mixed
$key : mixed
$value : mixed

insertBeforeKey()

public static insertBeforeKey(mixed $array, mixed $key, mixed $value) : mixed
Parameters
$array : mixed
$key : mixed
$value : mixed

        
On this page

Search results