Zum Hauptinhalt springen

Group array items

Anatomy

<array:group var="var" var_result="(destructive on 'var')" key="string"/>

Description: ARRAY:GROUP groups the items of a multidimensional array by a given key.

Attention:

If the key does not exist within the inner array, the corresponding item of the outer array will be discarded.

ARRAY:GROUP is destructive, in the sense that it modifies the array in-place, unless 'var_result' is specified in which case a copy of the resulting array will be stored in 'var_result' instead. It preserves the key and value associations of the array.

Attributes

NameTypeDescriptionDefined By
varvarVariable name array:group
var_resultvarResult variable name array:group
keystringKey array:group

Results:

BindingTypePredicate
varvar_resultarray