The simplest way is to loop through the array swapping each item with another item in a random position. Note that the array is indexed from 0, not 1.
Code:
for ( $i = 0; $i < $iLength; $i++ ){
$random = int(rand($#array));
$temp=$array[$random];
$array[$random]=$array[$i];
$array[$i]=$temp;
}
for ( $i = 0; $i < $iLength; $i++ ){
print "$array[$i]";
}
print "\n";