ez.no / ezpublish / documentation / reference / template operators / arrays
These documentation pages are no longer maintained. Please visit the new documentation site.
The following table contains a list of template operators related to arrays and array handling. Click on the name of an operator for more information about that specific operator (usage, parameters, description, examplets, etc.).
| Operator | Description |
|---|---|
| array_sum | Returns the sum of all elements in an array |
| append | Appends element(s) to an array. |
| array | Builds an array using specified elements. |
| array_append | DEPRECATED - use "append" instead. |
| array_merge | DEPRECATED - use "merge" instead |
| array_prepend | DEPRECATED - use "prepend" instead |
| begins_with | Checks if an array starts with a specific element/sequence. |
| compare | Compares the contents of two arrays. |
| contains | Checks if an array contains a specific element. |
| ends_with | Checks if an array ends with a specific element/sequence. |
| explode | Splits an array into an array of subarrays. |
| extract | Extracts a portion from an array. |
| extract_left | Extracts a portion from the start of an array. |
| extract_right | Extracts a portion from the end of an array. |
| hash | Creates a hash (associative array). |
| implode | Joins array elements with strings. |
| insert | Inserts an element/sequence at specified position in array. |
| merge | Merges input and passed arrays into one array. |
| prepend | Adds element(s) to start of an array. |
| remove | Removes element(s) from an array. |
| repeat | Repeats the contents of an array. |
| reverse | Reverses the contents of an array. |
| array_sum | Calculates the sum of values in an array. |
| unique | Removes duplicate values from an array. |
Comments
Custom operators
Kåre Køhler Høvik
Tuesday 12 October 2004 4:03:03 pm
Is there any "sort" function for arrays?
Martin Leblanc
Tuesday 12 October 2004 3:10:51 pm
array|count
Martin Leblanc
Friday 01 October 2004 11:42:20 am
Finding the number of elements in an array
Chris Fullerton
Monday 22 March 2004 9:24:29 pm
{$array|count}
will return the number of elements in the array.
It's documented in http://ez.no/ez_publish/documenta...ference/template_operators/variables