PHP array_fill() 函数
定义和用法
array_fill() 函数用给定的键值填充数组。
语法
array_fill(index,number,value);
参数 | 描述 |
---|---|
index | 必需。规定返回数组的起始索引。 |
number | 必需。规定填充的元素的数量,其值必须大于 0。 |
value | 必需。规定用于填充数组的键值。 |
技术细节
返回值: | 返回填充的数组。 |
---|---|
PHP 版本: | 4.2+ |

array_fill() 函数用给定的键值填充数组。
参数 | 描述 |
---|---|
index | 必需。规定返回数组的起始索引。 |
number | 必需。规定填充的元素的数量,其值必须大于 0。 |
value | 必需。规定用于填充数组的键值。 |
返回值: | 返回填充的数组。 |
---|---|
PHP 版本: | 4.2+ |