PHP - Funktion array_fill()
Beispiel
Füllen Sie ein Array mit Werten:
<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>
Definition und Verwendung
Die Funktion array_fill() füllt ein Array mit Werten.
Syntax
array_fill(index, number, value)
Parameterwerte
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 |
Technische Details
Rückgabewert: | Gibt das gefüllte Array zurück |
---|---|
PHP-Version: | 4.2+ |
❮ PHP-Array-Referenz