PHP array_fill()関数
例
配列に値を入力します。
<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>
定義と使用法
array_fill()関数は、配列に値を入力します。
構文
array_fill(index, number, value)
パラメータ値
Parameter | Description |
---|---|
index | Required. The first index of the returned array |
number | Required. Specifies the number of elements to insert |
value | Required. Specifies the value to use for filling the array |
技術的な詳細
戻り値: | 満たされた配列を返します |
---|---|
PHPバージョン: | 4.2+ |
❮PHP配列リファレンス