Zum Hauptinhalt springen

Array keys

Anatomy

<array:keys var="var" var_result="(destructive on 'var')"/>

Description: ARRAY:KEYS extracts all keys of an array.

Attention:

ARRAY:KEYS 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.

Attributes

NameTypeDescriptionDefined By
varvarVariable name array:keys
var_resultvarResult variable name array:keys

Results:

BindingTypePredicate
varvar_resultarray

Examples

Example

<array var="names">
<item key="bg">Bill Gates</item>
<item key="sj">Steve Jobs</item>
</array>

<array:keys var="names" var_result="keys"/>
<output>$keys[0] and $keys[1] are competitors!</output>

<!-- bg and sj are competitors! -->