shuffle

Shuffle a String, Number, or Array.


Syntax


Parameters

  • Mixed subject - The entity to shuffle.
    • String - The String will be shuffled.
    • Number - The Number will be treated as a String.
    • Array - The sequence of items in the Array will be shuffled.
  • Boolean preserve - The optional preserve parameter only has any effect if subject is an Array.
    • false (default) - The keys in the Array returned will be re-assigned from 0.
    • true - The original keys will be retained.


Result

  • Mixed - The shuffled subject.
    • String - If subject is a String or Number.
    • Array - If subject is an Array.

Returns subject with its elements in random order.

ptpscript/functions/shuffle.txt · Last modified: 2007/01/24 10:15
 
 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki