Onetastic Macro Documentation >
>
>
Array_PushFront Array_PushFront
Inserts the given value to the beginning of the array. All numerical keys in the array will be modified to start counting from zero while string keys won't be affected. Returns the number of elements in the array after the insertion.
Syntax
Numeric Array_PushFront(
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)
$sizeAfterFirstPushFront = Array_PushFront($array, 3)
$sizeAfterSecondPushFront = Array_PushFront($array, 7)
Array_PushFront($array2, 5)
Array_PushFront($array2, 7)
$array3[5] = 10
$array3[7] = 12
Array_PushFront($array3, 8)
Array_PushFront($array3, 6)
$array4["size"] = "large"
$array4[7] = "a"
$array4[-2] = "b"
$array4["color"] = "red"
Array_PushFront($array4, "t-shirt")
Array_PushFront($array4, 10)
Array_PushFront($array4, 5)
|