Onetastic Macro Documentation >
>
>
Array_Shuffle Array_Shuffle
Randomizes the order of elements in the given array.
Syntax
void Array_Shuffle(
Array array,
Bool preserveKeys)
Parameters
- Array array
- Array to shuffle.
- Bool preserveKeys
- If true, the values in the array will have the same keys as before, but just order changed. If false, the values will be assigned to new numeric keys starting from zero.
Examples
$array = Array(1, 2, 3, 4, 5, 6)
Array_Shuffle($array, false)
$array = Array(1, 2, 3, 4, 5, 6)
Array_Shuffle($array, true)
|