PHP array_fill() Function
Complete PHP Array Reference
Definition and Usage
The array_fill() function returns an array filled with the values you describe.
Syntax
|
array_fill(start,number,value)
|
| Parameter |
Description |
| start |
Required. A numeric value, specifies the starting index of the key |
| number |
Required. A numeric value, specifies the number of entries |
| value |
Required. Specifies the value to be inserted |
Example
<?php
$a=array_fill(2,3,"Dog");
print_r($a);
?>
|
The output of the code above will be:
|
Array ( [2] => Dog [3] => Dog [4] => Dog )
|
Complete PHP Array Reference

The Altova MissionKit is an integrated suite of tools ideal for:
- XML development
- Web & Web services development
- Data mapping & integration
- Rendering & publishing XML & database data
- XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy® - the industry-leading XML editor; MapForce® - a
graphical data mapping, conversion, and integration tool; StyleVision® - a visual XSLT stylesheet designer;
DiffDog® - an XML-aware diff/merge tool; and 2 additional tools.
Try all 6 products free for 30 days!
Download a fully-functional free trial
|
|
|
|