PHP array_fill() လုပ်ဆောင်ချက်
ဥပမာ
array တစ်ခုကို တန်ဖိုးများဖြင့် ဖြည့်ပါ-
<?php
$a1=array_fill(3,4,"blue");
print_r($a1);
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
array_fill() လုပ်ဆောင်ချက်သည် array တစ်ခုအား တန်ဖိုးများဖြင့် ဖြည့်ပေးသည်။
အထားအသို
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 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဖြည့်ထားသော array ကို ပြန်ပေးသည်။ |
---|---|
PHP ဗားရှင်း- | 4.2+ |
❮ PHP Array အကိုးအကား