Shuffle function

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.

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.