last.php
Table of Contents
Functions
- last() : string
- Get the last element of an array.
Functions
last()
Get the last element of an array.
last(mixed $anyArray) : string
This helper wraps the ArangoDB AQL function LAST(anyArray) which returns
the last element of the given array. If the array is empty, it returns null.
Example AQL usage:
LAST([1, 2, 3]) // returns 3
LAST(doc.items) // returns last item from doc.items
LAST([]) // returns null
Parameters
- $anyArray : mixed
-
Array expression to get the last element from.
Tags
Return values
string —The formatted AQL expression.