WireRandom::arrayValues()

Return a random version of given array or a quantity of random items

Array keys are retained in return value, unless requested $qty exceeds the quantity of items in given array.

Usage

// basic usage
$array = $wireRandom->arrayValues(array $a);

// usage with all arguments
$array = $wireRandom->arrayValues(array $a, int $qty = 0);

Arguments

NameType(s)Description
$aarray

Array to get random items from.

$qty (optional)int

Quantity of items, or 0 to return all Default:0

Return value

array


WireRandom methods and properties

API reference based on ProcessWire core version 3.0.251