دالة PHP array_fill ()
مثال
املأ المصفوفة بالقيم:
<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>
التعريف والاستخدام
تملأ الدالة array_fill () المصفوفة بالقيم.
بناء الجملة
array_fill(index, number, value)
قيمه المعامل
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 |
تفاصيل تقنية
قيمة الإرجاع: | إرجاع المصفوفة المعبأة |
---|---|
إصدار PHP: | 4.2+ |
❮ مرجع مصفوفة PHP