Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: September 02, 2024
Also available as a single HTML file

Onetastic Macro Documentation > Functions > Array Functions > Array_Merge

Array_Merge

Returns a new array that contains all the values in the given arrays. The values of each array are appended to the end of the previous one. If the arrays have the same string keys, then the later value for that key will overwrite the previous one. Numeric keys are not overwritten but instead will be appended. Values with numeric keys will be renumbered with incrementing keys starting from zero in the result array.

Syntax

Array Array_Merge(Array arrays...)

Parameters

Array arrays (optional)
Arrays to merge. No arrays or several arrays can be provided.

Examples

$array = Array_Merge() // $array is an empty array $array = Array_Merge(Array(1, 2, 3), Array(7, 8, 9), Array(-2, -4, -5)) // $array is (1, 2, 3, 7, 8, 9, -2, -4, -5) $array1["size"] = "large" $array1["color"] = "red" $array2["size"] = "small" $array2["type"] = "t-shirt" $array3["color"] = "blue" $array3["price"] = 10 $array = Array_Merge($array1, $array2, $array3) // This creates the following array: // "size" => "small" // "color" => "blue" // "type" => "t-shirt" // "price" => 10

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions