note 30798 added to function.array-fill
| From: | jausion at rack1 dot php dot net | Date: | Sat, 29 Mar 2003 05:50:51 +0000 |
| Subject: | note 30798 added to function.array-fill | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45969@lists.php.net to get a copy of this message | ||
For PHP < 4.2.0 users:
Add this to your script:
if (!function_exists('array_fill')) {
require_once('array_fill.func.php');
}
and the array_fill.func.php file:
<?php
// For PHP version < 4.2.0 missing the array_fill function,
// I provide here an alternative. -Philippe
function array_fill($iStart, $iLen, $vValue) {
$aResult = array();
for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) {
$aResult[$iCount] = $vValue;
}
return $aResult;
}
?>
--
http://www.php.net/manual/en/function.array-fill.php
http://master.php.net/manage/user-notes.php?action=edit+30798
http://master.php.net/manage/user-notes.php?action=delete+30798
http://master.php.net/manage/user-notes.php?action=reject+30798