PHP - array_fill
Trieda
Metóda - array_fill
(PHP 4 >= 4.2.0, PHP 5, PHP 7)
The function creates a new array filled with the entered values.
Procedurálne
- function array_fill (int $start_index, int $num, mixed $value) : array
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $start_index | int | The start index. | |
| $num | int | The number of elements. | |
| $value | mixed | A value to insert. |
Mávratovej hodnoty
Vracia: array
The filled array.
Príklady
<?php
$array = array_fill(0, 5, 'value');
print_r($array);
Súvisiace manuály
- function str_repeat (string $input, int $multiplier) : string
