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 |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | भरा हुआ सरणी लौटाता है |
---|---|
पीएचपी संस्करण: | 4.2+ |
पीएचपी ऐरे संदर्भ