PHP array_diff_assoc()
函数使用num
个条目的value
参数值来填充数组,从start_index
参数开始的键。
array array_fill ( int $start_index, int $num, mixed $value );
参数
- start_index - 返回数组的第一个索引
- num - 它包含要插入的元素的数量。
- value - 它包含使用填充的值。
返回值
- 它返回填充的数组。
示例
试试下面的例子 -
<?php
$input = array_fill(5, 6, 'apple');
print_r($input);
?>
这将产生以下结果 -
Array (
[5] => apple
[6] => apple
[7] => apple
[8] => apple
[9] => apple
[10] => apple
)