Multi-Dimensional array is an array within array. It is the most common used php function to store multiple values within a variable.
Here is my small snippet share for shuffling multidimentional array values.
Just call this function and pass the multidimensional array through parameters.
[php]public static function shuffle_array($array)
if (!is_array($array)) return $array;
$keys = array_keys($array);
shuffle($keys);
$random = array();
foreach ($keys as $key) {
$shuffle[] = $array[$key];
}
return $shuffle;
}
[/php]
This is really helpful - thanks for posting.
ReplyDelete:)
ReplyDelete