This article will introduce to you some commonly used PHP example programs for obtaining random arrays in arrays. I hope this method will be helpful to all my friends.
Post a piece of code to get a random array in php. Needless to say, just post the code directly. array_rand in php is very abnormal, breaking through the understanding of normal people, and is cumbersome
Example 1
The code is as follows
| Copy code
| ||||
{
$_base_ids = range($min,$max); <img src="/static/imghw/default1.png" data-src="http://www.bkjia.com/uploads/allimg/131231/132F0A18-0.jpg" class="lazy" style="max-width:90%" alt="php 随机打乱一个数组的排序shuffle - 九重海 - jiuchonghai-PHP的博客" __1379995076531__="ev_3284125348"> Copy after login Copy after login <strong>第二次得到的结果为: </strong> Copy after login <img src="/static/imghw/default1.png" data-src="http://www.bkjia.com/uploads/allimg/131231/132F04U9-1.jpg" class="lazy" style="max-width:90%" alt="php 随机打乱一个数组的排序shuffle - 九重海 - jiuchonghai-PHP的博客" __1379995076531__="ev_5189766409"> Copy after login <strong>第三次得到的结果为:<br></strong> <img src="/static/imghw/default1.png" data-src="http://www.bkjia.com/uploads/allimg/131231/132F03115-2.jpg" class="lazy" style="max-width:90%" alt="php 随机打乱一个数组的排序shuffle - 九重海 - jiuchonghai-PHP的博客" __1379995076531__="ev_6379571093"> Copy after login |
Example 2