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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.