<?php
// array_fill 用于用指定的值填充数组,从指定的索引开始,重复指定的次数。
// 示例代码:
$filled_array = array_fill(0, 5, 'apple');
print_r($filled_array);
/*
输出结果:
Array
(
[0] => apple
[1] => apple
[2] => apple
[3] => apple
[4] => apple
)
*/
// 解释说明:
// array_fill(0, 5, 'apple') 表示从索引 0 开始,填充 5 次,每次填充的值为 'apple'。
?>
上一篇:php codeigniter
下一篇:php遍历数组
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站