array_fill

PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
array_fill - Fill an array with values

Example #1 array_fill example

Result: Array ( [5] => banana [6] => banana [7] => banana [8] => banana [9] => banana [10] => banana ) Array ( [-2] => pear [0] => pear [1] => pear [2] => pear )
PHP Version:


Example #2 of array_fill

PHP Version:


Function array_fill:

Arrays Functions

Most used PHP functions