WireArray::findRandom() method

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.244

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani