PHP Function to fill an array with specified values – PHP May 11, 2011 Pramod T P Leave a comment <?php $testArray = array_fill(5, 3, 'Value1'); print_r($testArray); //Array ( [5] => Value1 [6] => Value1 [7] => Value1 ) ?>