5 The random function was added in Twig 1.5.
8 String and integer handling was added in Twig 1.6.
10 The ``random`` function returns a random value depending on the supplied
13 * a random item from a sequence;
14 * a random character from a string;
15 * a random integer between 0 and the integer parameter (inclusive).
19 {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #}
20 {{ random('ABC') }} {# example output: C #}
21 {{ random() }} {# example output: 15386094 (works as native PHP `mt_rand`_ function) #}
22 {{ random(5) }} {# example output: 3 #}
27 * ``values``: The values
29 .. _`mt_rand`: http://php.net/mt_rand