Usage of shuffle Array Value Random Sorting Function in PHP
- 2021-08-05 09:29:08
- OfStack
This article example tells the shuffle array value casual sorting function usage, to share for everyone for your reference.
The specific example code is as follows:
$typename=20;
$rtitle='tt';
for( $i=0;$i<=20;$i++)
{
$rtitle_rand = array($typename,$rtitle,$typename);
shuffle($rtitle_rand);// Arrays are randomly sorted
echo $rtitle_rand['0'].'<br />';
}
I hope this article is helpful to everyone's PHP programming.