Skip to main content

Position of first/last occurrence

Anatomy

<array:pos var="var" var_result="var" offset="int" type="first">
string
</array:pos>

Description: ARRAY:POS finds the position of first or last occurrence of a value within an array and returns the key of the corresponding array item if applicable.

If the offset is negative it will start that many items from the end of the array.

Attributes

NameTypeDescriptionDefined By
varvarVariable name array:pos
var_resultvarResult variable name array:pos
offsetintSearch offset array:pos
typetypeMeasurement type array:pos

Results:

BindingTypePredicate
var_resultN/A

Examples

Example

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

<output>
<array:pos var="names">Steve Jobs</array:pos>
</output>

<!-- 1 -->