ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Array.php File Reference

Go to the source code of this file.

Data Structures

class  Twig_Extensions_Extension_Array
 This file is part of Twig. More...
 

Functions

 twig_shuffle_filter ($array)
 Shuffles an array. More...
 

Function Documentation

◆ twig_shuffle_filter()

twig_shuffle_filter (   $array)

Shuffles an array.

Parameters
array | Traversable$arrayAn array
Returns
array

Definition at line 45 of file Array.php.

Referenced by Twig_Tests_Extension_ArrayTest\testShuffleFilter(), and Twig_Tests_Extension_ArrayTest\testShuffleFilterOnEmptyArray().

46 {
47  if ($array instanceof Traversable) {
48  $array = iterator_to_array($array, false);
49  }
50 
51  shuffle($array);
52 
53  return $array;
54 }
+ Here is the caller graph for this function: