|
directorySorting a structure randomlyHi Guys! this is my first post. So forgive me if the question could seem stupid I have a directory scanner that retrieve me the list of movies in a specific folder. I'd like to "randomize the order" of that list, so every time i trig the structure, i can scramble the order. I've tried with javascript with something like this
PHP Code:
function (__structure out) main (__structure input){
if(input !=null){
var result=new Object();
result.out=input.sort(function(){return (Math.round(Math.random())-0.5));
return result;
}
} Any solution??? Thanks
|