admin 发表于 2023-2-16 18:54:56

在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>该函数为数组中的元素分配新的键名&#xff0c;已存在的键名将被删除&#xff08;参见下面的实例 1&#xff09;。</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>返回值&#xff1a;</th><td>如果成功则返回 TRUE&#xff0c;如果失败则返回 FALSE。</td></tr><tr><th>PHP 版本&#xff1a;</th><td>4&#43;</td></tr><tr><th>更新日志&#xff1a;</th><td>自 PHP 4.2.0 起&#xff0c;随机数生成器会自动播种。</td></tr></tbody></table>
<p></p>
<p> </p>
<p></p>
                </div>
      </div>
      <div id="treeSkill"></div>
页: [1]
查看完整版本: 在PHP中使用shuffle()函数