PHP array_fill() 函数

PHP 教程 · 2019-01-22 07:28:26

实例

用给定的键值填充数组:

<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>

定义和用法

array_fill() 函数用给定的键值填充数组。

语法

array_fill(index,number,value);

参数 描述
index 必需。规定返回数组的起始索引。
number 必需。规定填充的元素的数量,其值必须大于 0。
value 必需。规定用于填充数组的键值。

技术细节

返回值: 返回填充的数组。
PHP 版本: 4.2+

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

iGen

iGen

Jean M. Twenge PhD / Atria Books / 2017-8-22 / USD 27.00

A highly readable and entertaining first look at how today’s members of iGen—the children, teens, and young adults born in the mid-1990s and later—are vastly different from their Millennial predecesso......一起来看看 《iGen》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

在线进制转换器
在线进制转换器

各进制数互转换器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具