public function shuffle_list_key($arr, $key)
{
$key_list = array();
// shuffle the key array
foreach ($arr as $row) {
if (isset($row[$key])) {
$key_list[] = $row[$key];
}
}
shuffle($key_list);
// rebuld the list with the shuffled key
$i = 0;
foreach ($arr as &$row) {
if (isset($key_list[$i])) {
$row[$key] = $key_list[$i];
}
++$i;
}
unset($row);
return $arr;
}