Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

compare

Summary

Compares the contents of two arrays.

Usage

input|compare( array )

Parameters

NameTypeDescriptionRequired
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.

Balazs Halasy (05/02/2004 9:30 am)

Geir Arne Waaler (08/02/2011 9:52 am)

Balazs Halasy, Julia Shymova, Geir Arne Waaler


Comments

There are no comments.