Unsets a value in a multi-dimensional array.


Syntax

array_unset(array $array, array $members): array


Parameter

@param array $array A multi-dimensional numeric or associative array. If no array is given, an empty one is created automatically.

@param array $members A numerical array containing the member path for the value you want to set.

@param $value The value you want to set.


Return

Returns the complete modified array.


Examples

To unset for example the key in array:

myArr['a']['sub']

you simply write In your twig source code:

{% set myArr = hublify.array_unset(myArr, ['a','sub']) %}