PHP array_fill() Function

PHP Array Reference : Fill an array with values

Definition and Usage

The array_fill() function fills an array with values.

Syntax

array_fill(index, number, value)

Parameter Values

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

Technical Details

Return Value: Returns the filled array
PHP Version: 4.2+

❮ PHP Array Reference