Skip to the content
Documentation

ends_with

No ratings yet

Summary

Checks if an array ends with a specific element or sequence.

Usage

input|ends_with( element1 [, element2 [, ... ] ] )

Parameters

Name Type Description Required
element1 any An element that should be matched. Yes.
element2 any Another element that should be matched. No.

Returns

TRUE or FALSE.

Description

This operator checks if the input array ends with a specified sequence of elements. If yes, the operator returns TRUE, otherwise FALSE will be returned.

Examples

Example 1
{array( 1, 2, 3, 4, 5, 6, 7 )|ends_with( 5, 6, 7 )}

Returns TRUE.

Example 2
{array( 1, 2, 3, 4, 5, 6, 7 )|ends_with( 4, 5, 6 )}

Returns FALSE.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.