Fill the array with the given key values:
<?php$a1=array_fill(3,4,"blue");print_r($a1);?>The array_fill() function fills an array with the given key values.
array_fill( index,number,value );
parameter | describe |
---|---|
index | Required. Specifies the starting index of the returned array. |
number | Required. Specifies the number of elements to fill. Its value must be greater than 0. |
value | Required. Specifies the key values used to populate the array. |
Return value: | Returns the populated array. |
---|---|
PHP version: | 4.2+ |