← All built-ins / array_fill()
array_fill()
array_fill(...$args): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $start | int | first index |
| $num | int | element count |
| $value | mixed | fill value |
Return value
Array with $num copies of $value starting at $start.
Example
echo implode(",", array_fill(0, 3, "x"));x,x,x