summaryrefslogtreecommitdiff
path: root/array_fill.func.php
blob: 6100622fbfaaf2c4b01e50bc7573a5c047d3fc8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
 * @package kernel
 * @subpackage functions
 */

// For PHP version < 4.2.0 missing the array_fill function,
// I provide here an alternative. -Philippe
// taken from http://de3.php.net/manual/en/function.array-fill.php comments. thanks jausion at hotmail-dot-com

/**
 * array_fill
 */
if( !function_exists( 'array_fill' ) ) {
	function array_fill($iStart, $iLen, $vValue) {
		$aResult = array();
		for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) {
			$aResult[$iCount] = $vValue;
		}
		return $aResult;
	}
}

?>