Shuffle function
This shuffle function shuffles (ie., randomize the elements of an array). We can use this function in the case of displaying images randomly in our website.
Syntax :void shuffle ( array array)
void shuffle ( array array)Example :$arr = array(’1.jpg’,'2.jpg’,'3.jpg’,'4.jpg’,'5.jpg’);
$arr = array(’1.jpg’,'2.jpg’,'3.jpg’,'4.jpg’,'5.jpg’);shuffle($arr);
print_r($arr); // Here we can get the shuffled array. Using this array we can display the images.
