PHP array_fill() Fungsi
Contoh
Isi array dengan nilai:
<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>
Definisi dan Penggunaan
Fungsi array_fill() mengisi array dengan nilai.
Sintaksis
array_fill(index, number, value)
Nilai Parameter
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 |
Detail Teknis
Nilai Kembali: | Mengembalikan array yang terisi |
---|---|
Versi PHP: | 4.2+ |
Referensi Array PHP