Skip to content

Kirby 5.0.2

A::random()

Returns a number of random elements from an array, either in original or shuffled order

A::random(array $array, int $count = 1, bool $shuffle = false): array

Parameters

Name Type Default
$arrayrequired array no default value
$count int 1
$shuffle bool false

Return type

array

Exceptions

Type Description
Exception When $count is larger than array length

Parent class

Kirby\Toolkit\A