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

查看所有标签

Beginning iPhone and iPad Web Apps

Beginning iPhone and iPad Web Apps

Chris Apers、Daniel Paterson / Apress / 2010-12-15 / USD 39.99

It seems that everyone and her sister has developed an iPhone App—everyone except you, the hard-working web professional. And now with the introduction of the iPad, you may even feel farther behind. B......一起来看看 《Beginning iPhone and iPad Web Apps》 这本书的介绍吧!

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

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具