在PHP中使用shuffle()函数
<div id="article_content" class="article_content clearfix"><link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-6e43165c0a.css">
<div id="content_views" class="htmledit_views">
<h2>定义和用法</h2>
<p>shuffle() 函数把数组中的元素按随机顺序重新排列。</p>
<p>该函数为数组中的元素分配新的键名,已存在的键名将被删除(参见下面的实例 1)。</p>
<hr>
<h2>语法</h2>
<p>shuffle(<em>array</em>)</p>
<p></p>
<table><tbody><tr><th>参数</th><th>描述</th></tr><tr><td style="vertical-align:top;"><em>array</em></td><td style="vertical-align:top;">必需。规定要使用的数组。</td></tr></tbody></table>
<h2>技术细节</h2>
<table><tbody><tr><th>返回值:</th><td>如果成功则返回 TRUE,如果失败则返回 FALSE。</td></tr><tr><th>PHP 版本:</th><td>4+</td></tr><tr><th>更新日志:</th><td>自 PHP 4.2.0 起,随机数生成器会自动播种。</td></tr></tbody></table>
<p></p>
<p> </p>
<p></p>
</div>
</div>
<div id="treeSkill"></div>
页:
[1]