arrays - How do I randomly jumble a string imploded by ',' in PHP (ex: a,b,c = c,b,a) in a oneliner? -
how randomly jumble string imploded ',' in php (ex: a,b,c = c,b,a) in one-liner?
here example
srand((double)microtime*1000000); $foo=array( => "a", b => "b", c => "c"); echo "the jumbled comma separated values are: ".randomlyjumble(.implode(",",$foo))."<br />";
use shuffle
before imploding. keep in mind shuffle
takes parameter reference inline modification, need on separate line.
Comments
Post a Comment