WireArray::findRandom()

Find a specified quantity of random elements from this WireArray.

Unlike WireArray::getRandom() this method always returns a WireArray (or derived type).

Example

// Get 3 random items
$randomItems = $items->findRandom(3); 

Usage

$items = $wireArray->findRandom(int $num);

Arguments

NameType(s)Description
$numint

Number of items to return

Return value

See Also


WireArray methods and properties

API reference based on ProcessWire core version 3.0.251