array.add Function |
The array.add function appends an item to the tail of a specified array.
array.add(ident, expr);
ident | Required. The array |
expr | Required. An expression to append to the tail of the array |
The following example creates a new array initialized with two elements: '1' and '2'.
We then append a third element, '3', to the end of the array using the array.add function.
$arr = array.new(1, 2); PRINT $arr; /* [1,2] */ array.add($arr, 3); PRINT $arr; /* [1,2,3] */
array.last - get the last element of an array
array.new - create a new array
array.pop - remove and return the element at the head of the array
array.set_at - modify the data at a specified index of an array
array.get_at - retrieve the data at a specified index of an array
length - get the number of elements in an array