Php shuffle() Function

In the php shuffle() function is used to display the random elements from array list. These functions remove keys if keys existing from array list and otherwise assigns new keys. Which functions will returns two outputs that are true and false.

Demo :



Minimum No : Maximum No :  
Out Put : 0

Example :

Minimum No: 1
Maximum No: 5

Following code is shuffle() function if you need to copy and use to your website.


<?php
  $numbers = range(1,5);
  shuffle($numbers);
  echo join (", ", $numbers);
?>

In the above range() function value has been stored in $numbers variable.range() function in have two arguments that is mixed low,mixed high.Then $numbers variable pass to shuffle() function. which have been generated shuffle values to array.shuffle() function is one arguments that name is array array_arg.

Free Download Script :

If you need to shuffle() function code click and download from following link.

Download




Content