array array_fill ( int $start_index, int $num, mixed $value );
它用值参数值的编号项填充数组,键从start_index参数开始。
Sr.No | Parameter & Description |
---|---|
1 |
start_index 返回数组的第一个索引 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-array-fills.html 来源:LearnFk无涯教程网 |
2 |
num 它包含要插入的元素的数量 |
3 |
value 它包含要使用填充的值 |
它返回填充的数组
<?php $input=array_fill(5, 6, 'apple'); print_r($input); ?>
这将产生以下输出-
Array ( [5] => apple [6] => apple [7] => apple [8] => apple [9] => apple [10] => apple )
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)