admin 发表于 2023-2-16 18:55:01

PHP中的array_fill()函数

<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">
                  <p><?</p>
<p>$a1 &#61; array_fill(3,4,&#34;blue&#34;);</p>
<p>print_r($a1);</p>
<p>?></p>
<p></p>
<p> </p>
<h2>定义和用法</h2>
<p>array_fill() 函数用给定的键值填充数组。</p>
<hr>
<h2>语法</h2>
<p>array_fill(<em>index,number,value</em>);</p>
<p></p>
<table><tbody><tr><th>参数</th><th>描述</th></tr><tr><td><em>index</em></td><td>必需。规定返回数组的起始索引。</td></tr><tr><td><em>number</em></td><td>必需。规定填充的元素的数量&#xff0c;其值必须大于 0。</td></tr><tr><td><em>value</em></td><td>必需。规定用于填充数组的键值。</td></tr></tbody></table>
                </div>
      </div>
      <div id="treeSkill"></div>
页: [1]
查看完整版本: PHP中的array_fill()函数