PHP array_fill() Function
Complete PHP Array Reference Manual
Example
Fill an array with a given value:
Run Example »
Definition and Usage
The array_fill() function fills an array with a given value.
Syntax
array_fill(
index,number,value
);
| Parameters | Description |
|---|---|
| index | Required. Specifies the starting index of the returned array. |
| number | Required. Specifies the number of elements to fill; the value must be greater than 0. |
| value | Required. Specifies the value used to fill the array. |
Technical Details
| Return Value: | Returns the filled array. |
|---|---|
| PHP Version: | 4.2+ |
Complete PHP Array Reference Manual