Array & List Functions

Adds Values to an Array, Combines & Splits Arrays. Returns Values from Arrays.
  • ADD_TO_ARRAY

    Adds values to an array

    ADD_TO_ARRAY([1,2,3],4,5)
    Try this example
    array (array)
    Initial array
    value1 (mixed)
    Element to add
  • ARRAY_CHANGE_KEY_CASE

    Changes the case of all keys in an array

    ARRAY_CHANGE_KEY_CASE([1,2,3])
    Try this example
    array (array)
    The array to work on
    case (string)
    Allowed values: "upper", "lower" (default)
  • ARRAY_CHUNK

    Split an array into chunks

    ARRAY_CHUNK([1,2,3],1)
    Try this example
    array (array)
    The array to work on
    size (number)
    The size of each chunk
  • ARRAY_COLUMN

    Return the values from a single column in the input array

    ARRAY_COLUMN({var1},"username")
    Try this example
    input (array)
    A multi-dimensional array or an array of objects from which to pull a column of values from.
    column_key (any)
    The column of values to return. This value may be an integer key of the column you wish to retrieve, or it may be a string key name for an associative array or property name.
  • ARRAY_COMBINE

    Creates an array by using one array for keys and another for its values

    ARRAY_COMBINE([1,2,3],[4,5,6])
    Try this example
    keys (array)
    Array of keys to be used. Illegal values for key will be converted to string.
    values (array)
    Array of values to be used
  • ARRAY_COUNT_VALUES

    Counts all the values of an array

    ARRAY_COUNT_VALUES([1,2,3,1])
    Try this example
    array (array)
    The array of values to count
  • ARRAY_DIFF

    Computes the difference of arrays

    ARRAY_DIFF({var1},{var2})
    Try this example
    array1 (array)
    The array to compare from
    array2 (array)
    An array to compare against
  • ARRAY_DIFF_ASSOC

    Computes the difference of arrays with additional index check

    ARRAY_DIFF_ASSOC({var1},{var2})
    Try this example
    array1 (array)
    The array to compare from
    array2 (array)
    An array to compare against
  • ARRAY_DIFF_KEY

    Computes the difference of arrays using keys for comparison

    ARRAY_DIFF_KEY({var1},{var2})
    Try this example
    array1 (array)
    The array to compare from
    array2 (array)
    An array to compare against
  • ARRAY_FILL

    Fill an array with values

    ARRAY_FILL(5,6,"banana")
    Try this example
    start_index (number)
    The first index of the returned array.
    num (number)
    Number of elements to insert. Must be greater than or equal to zero.
  • ARRAY_FILL_KEYS

    Fill an array with values, specifying keys

    ARRAY_FILL_KEYS([1,2,3],"value")
    Try this example
    keys (array)
    Array of values that will be used as keys. Illegal values for key will be converted to string.
    value (string)
    Value to use for filling
  • ARRAY_FLIP

    Exchanges all keys with their associated values in an array

    ARRAY_FLIP([1,2,3])
    Try this example
    array (array)
    An array of key/value pairs to be flipped.
  • ARRAY_INTERSECT

    Computes the intersection of arrays

    ARRAY_INTERSECT({var1},{var2})
    Try this example
    array1 (array)
    The array with master values to check.
    array2 (array)
    An array to compare values against.
  • ARRAY_INTERSECT_ASSOC

    Computes the intersection of arrays with additional index check

    ARRAY_INTERSECT_ASSOC({var1},{var2})
    Try this example
    array1 (array)
    The array with master values to check.
    array2 (array)
    An array to compare values against.
  • ARRAY_INTERSECT_KEY

    Computes the intersection of arrays using keys for comparison

    ARRAY_INTERSECT_KEY({var1},{var2})
    Try this example
    array1 (array)
    The array with master keys to check.
    array2 (array)
    An array to compare keys against.
  • ARRAY_KEYS

    Return all the keys or a subset of the keys of an array

    ARRAY_KEYS([1,2,3])
    Try this example
    array (array)
    An array containing keys to return.
  • ARRAY_KEY_EXISTS

    Checks if the given key or index exists in the array

    ARRAY_KEY_EXISTS("1",[1,2,3])
    Try this example
    key (any)
    Value to check.
    array (array)
    An array with keys to check.
  • ARRAY_KEY_FIRST

    Gets the first key of an array

    ARRAY_KEY_FIRST([1,2,3])
    Try this example
    array (array)
    An array.
  • ARRAY_KEY_LAST

    Gets the last key of an array

    ARRAY_KEY_LAST()
    Try this example
    array (array)
    An array.
  • ARRAY_MERGE

    Merge one or more arrays

    ARRAY_MERGE([1,2,3],[4,5,6])
    Try this example
    value1 (mixed)
    Variable list of arrays to merge.
    value2 (mixed)
    Variable list of arrays to merge.
  • ARRAY_MERGE_RECURSIVE

    Merge one or more arrays recursively

    ARRAY_MERGE_RECURSIVE({var1},{var2})
    Try this example
    value1 (mixed)
    Variable list of arrays to recursively merge.
    value2 (mixed)
    Variable list of arrays to recursively merge.
  • ARRAY_PAD

    Pad array to the specified length with a value

    ARRAY_PAD()
    Try this example
    array (array)
    Initial array of values to pad.
    size (number)
    New size of the array.
  • ARRAY_POP

    Pop the element off the end of array

    ARRAY_POP([1,2,3])
    Try this example
    array (array)
    The array to get the value from.
  • ARRAY_PUSH

    Push one or more elements onto the end of array

    ARRAY_PUSH([1,2,3],4)
    Try this example
    array (array)
    The input array.
    item (mixed)
    The values to push onto the end of the array.
  • ARRAY_RAND

    Pick one or more random keys out of an array

    ARRAY_RAND([1,2,3],2)
    Try this example
    array (array)
    The input array.
    num (number)
    Specifies how many entries should be picked.
  • ARRAY_REPLACE

    Replaces elements from passed arrays into the first array

    ARRAY_REPLACE({var1},{var2})
    Try this example
    array1 (array)
    The array in which elements are replaced.
    array2 (array)
    Arrays from which elements will be extracted. Values from later arrays overwrite the previous values.
  • ARRAY_REPLACE_RECURSIVE

    Replaces elements from passed arrays into the first array recursively

    ARRAY_REPLACE_RECURSIVE({var1},{var2})
    Try this example
    array1 (array)
    The array in which elements are replaced.
    array2 (array)
    Optional. Arrays from which elements will be extracted.
  • ARRAY_REVERSE

    Return an array with elements in reverse order

    ARRAY_REVERSE()
    Try this example
    array (array)
    The input array.
  • ARRAY_SEARCH

    Searches the array for a given value and returns the first corresponding key if successful

    ARRAY_SEARCH()
    Try this example
    needle (any)
    The searched value.
    haystack (array)
    The array.
  • ARRAY_SHIFT

    Shift an element off the beginning of array

    ARRAY_SHIFT()
    Try this example
    array (array)
    The input array.
  • ARRAY_SLICE

    Extract a slice of the array

    ARRAY_SLICE([1,2,3,4,5],0,1)
    Try this example
    array (array)
    The input array.
    offset (number)
    If offset is non-negative, the sequence will start at that offset in the array. If offset is negative, the sequence will start that far from the end of the array.
  • ARRAY_SPLICE

    Remove a portion of the array and replace it with something else

    ARRAY_SPLICE([1,2,3,4],1,1)
    Try this example
    input (array)
    The input array.
    offset (number)
    If offset is positive then the start of the removed portion is at that offset from the beginning of the input array. If offset is negative then the start of the removed portion is at that offset from the end of the input array.
  • ARRAY_SUM

    Calculate the sum of values in an array

    ARRAY_SUM([1,2,3,4])
    Try this example
    array (array)
    The input array.
  • ARRAY_UNIQUE

    Removes duplicate values from an array

    ARRAY_UNIQUE([1,2,2,3,3])
    Try this example
    array (array)
    The input array.
  • ARRAY_UNSHIFT

    Prepend one or more elements to the beginning of an array

    ARRAY_UNSHIFT([1,2,3],1)
    Try this example
    array (array)
    The input array.
    value (mixed)
    The values to prepend.
  • ARRAY_VALUES

    Return all the values of an array

    ARRAY_VALUES({var1})
    Try this example
    array (array)
    The array.
  • ARSORT

    Sort an array in reverse order and maintain index association

    ARSORT({var1})
    Try this example
    array (array)
    The input array.
  • ASORT

    Sort an array and maintain index association

    ASORT({var1})
    Try this example
    array (array)
    The input array.
  • CONCAT_ARRAY

    Method is used to join two or more arrays.

    CONCAT_ARRAY([1,2,3],[4,5,6])
    Try this example
    array1 (array)
    First array
    array2 (array)
    Optional: second array
  • CONTAINS_ARRAY

    Determines whether a value exists in array

    CONTAINS_ARRAY([1,2,3],1)
    Try this example
    array (array)
    Initial array
    value (any)
    Value to search in array
  • COUNT_ARRAY_ELEMENTS

    Count all elements in an array, or something in an object

    COUNT_ARRAY_ELEMENTS([1,2,3,4])
    Try this example
    array_or_countable (array)
    An array or Countable object.
  • DISTINCT

    Removes duplicates elements in array.

    DISTINCT([1,2,2])
    Try this example
    array (array)
    Initial array
  • EXPLODE

    Split a string by a string

    EXPLODE("-","1-2-3")
    Try this example
    delimiter (string)
    The boundary string.
    string (string)
    The input string.
  • FILL

    Fills the specified elements in an array with a static value.

    FILL([1,2,3],4)
    Try this example
    array (array)
    Initial array
    value (any)
    The value to fill the array with
  • FIRST

    Returns first element value from array or object

    FIRST([1,2,3])
    Try this example
  • FLATTEN

    Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.

    FLATTEN([1,2,[3,4]])
    Try this example
  • GET

    Returns value from array or object by a specific key

    GET({"a":1,"b":2},"a")
    Try this example
  • GET_COMPLEX

    Returns value from object by a specific deep key

    GET_COMPLEX({"a":{"b":1,"c":2},"d":2},"a.b")
    Try this example
  • IMPLODE

    Join array elements with a string

    IMPLODE(",",[1,2,3])
    Try this example
    glue (string)
    Defaults to an empty string.
    pieces (array)
    The array of strings to implode.
  • INDEXOF_ARRAY

    Searches the array for the specified item, and returns its position.

    INDEXOF_ARRAY([1,2,3],3)
    Try this example
    array (array)
    Initial array
    value (any)
    The item to search for
  • IN_ARRAY

    Checks if a value exists in an array

    IN_ARRAY(1,[1,2,3])
    Try this example
    needle (any)
    The searched value. If needle is a string, the comparison is done in a case-sensitive manner.
    haystack (any)
    The array.
  • ISARRAY

    Determines whether an object is an array.

    ISARRAY([1,2,3])
    Try this example
    array (array)
    Initial array
  • JOIN

    Concatenate all the elements of array into a one string with a string

    JOIN([1,2,3],"-")
    Try this example
    array (array)
    Initial array
    separator (string)
    String as glue
  • JOIN_ARRAY

    Join array elements with a string

    JOIN_ARRAY(",",[1,2,3])
    Try this example
    glue (string)
    Defaults to an empty string.
    pieces (array)
    The array of strings to implode.
  • KEYS

    Return all the keys or a subset of the keys of an array

    KEYS({var1})
    Try this example
    object (array)
    Initial array or object
  • KEY_EXISTS

    Checks if the given key or index exists in the array

    KEY_EXISTS(1,[1,2,3])
    Try this example
    key (any)
    Value to check.
    array (array)
    An array with keys to check.
  • KRSORT

    Sort an array by key in reverse order

    KRSORT({var1})
    Try this example
    array (array)
    The input array.
  • KSORT

    Sort an array by key

    KSORT({var1})
    Try this example
    array (array)
    The input array.
  • LENGTH_ARRAY

    Count all elements in an array, or something in an object

    LENGTH_ARRAY([1,2,3])
    Try this example
    array (array)
    Initial array
  • MERGE

    Merge one or more arrays

    MERGE([1,2,3],[4,5,6])
    Try this example
    array1 (array)
    First array
    array2 (array)
    Second array
  • NATCASESORT

    Sort an array using a case insensitive "natural order" algorithm

    NATCASESORT({var1})
    Try this example
    array (array)
    The input array.
  • NATSORT

    Sort an array using a "natural order" algorithm

    NATSORT({var1})
    Try this example
    array (array)
    The input array.
  • POP

    Removes the last element of an array

    POP([1,2,3])
    Try this example
    array (array)
    Initial array
  • PUSH

    Adds new items to the end of an array

    PUSH([1,2,3],4)
    Try this example
    array (array)
    Initial array
    element (any)
    The item to add to the array
  • RANGE

    Create an array containing a range of elements

    start (any)
    First value of the sequence.
    end (any)
    The sequence is ended upon reaching the end value.
  • REMOVE

    Removes elements from array by value

    REMOVE([1,2,3],1)
    Try this example
    array (array)
    Initial array
    value (any)
    Value to remove from array
  • REVERSE

    Return an array with elements in reverse order

    REVERSE([1,2,3])
    Try this example
    array (array)
    Initial array
  • RSORT

    Sort an array in reverse order

    RSORT({var1})
    Try this example
    array (array)
    The input array.
  • SHIFT

    Removes the first item of an array.

    SHIFT([1,2,3])
    Try this example
    array (array)
    Initial array
  • SHUFFLE

    Shuffle an array

    SHUFFLE([1,2,3])
    Try this example
    array (array)
    The array.
  • SIZEOF

    Count all elements in an array, or something in an object

    SIZEOF([1,2,3])
    Try this example
    array_or_countable (array)
    An array or Countable object.
  • SLICE

    Extract a slice of the array

    SLICE([1,2,3],0,1)
    Try this example
    array (array)
    Initial array
    start (number)
    Start index, first index 1
  • SORT

    Sorts values of array.

    SORT([1,2,3],"ASC")
    Try this example
    array (array)
    Initial array
    order (string)
    Acceptable values: "ASC", "DESC"
  • SORT_ARRAY

    Sort an array

    SORT_ARRAY([3,1,2])
    Try this example
    array (array)
    The input array.