Click or drag to resize

array.first Function

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
array.first Function

The array.first function returns the first element (the head) of a given array.

Syntax

Alchemy
array.first(ident);

Nomenclature

ident Required. The array to find the first element of

Returns

The first (head) element of the given array.

Example

Alchemy
$arr = array.new(2, 3, 4);
PRINT array.first($arr); /* 2 */

See Also

  • array.add - add an element to the tail of an array

  • array.join - convert an array to a string by joining all the elements

  • 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.range - return a sub-array from a specified 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