Onetastic Macro Documentation >
>
>
Array_PushBack Array_PushBack
Inserts the given value to the end of the array. Returns the number of elements in the array after the insertion. To use an array as a stack, use this function along with Array_PopBack. To use an array as a queue, use this function along with Array_PopFront.
Syntax
Numeric Array_PushBack(
byref Array array,
Mixed value)
Parameters
- Array array
- Array to insert the value to.
- Mixed value
- The value to insert.
Examples
$array = Array(6, 4, 8)
$sizeAfterFirstPushBack = Array_PushBack($array, 3)
$sizeAfterSecondPushBack = Array_PushBack($array, 7)
Array_PushBack($array2, 5)
Array_PushBack($array2, 7)
$array3["size"] = "large"
$array3["color"] = "red"
Array_PushBack($array3, "t-shirt")
Array_PushBack($array3, 10)
$array4[7] = "a"
$array4[-2] = "b"
$array4["price"] = 100
Array_PushBack($array4, "first")
Array_PushBack($array4, "second")
|