Skip to the content
Documentation

compare

No ratings yet

Summary

Compares the contents of two arrays.

Usage

input|compare( array )

Parameters

Name Type Description Required
array array The array that should be compared with the input array. Yes.

Returns

TRUE if arrays are equal, FALSE if not.

Description

This operator compares the contents of two arrays, the input array and an array that is provided as the first (and only) parameter. If the arrays are equal, the operator returns TRUE, otherwise FALSE will be returned.

Examples

Example 1
{array( 1, 2, 3, 4, 5 )|compare( array( 1, 2, 3, 4, 5 ))}

Returns TRUE.

Example 2
{array( 1, 2, 3, 4, 5 )|compare( array( 5, 4, 3, 2, 1 ))}

Returns TRUE.

Example 3
{array( 1, 2, 3, 4, 5 )|compare( array( 1, 2, 4, 3, 3 ))}

Returns FALSE.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.