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://codercto.com/courses/l/5.html

查看所有标签

HTML5

HTML5

Matthew David / Focal Press / 2010-07-29 / USD 39.95

Implement the powerful new multimedia and interactive capabilities offered by HTML5, including style control tools, illustration tools, video, audio, and rich media solutions. Understand how HTML5 is ......一起来看看 《HTML5》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具