Ouwe rakker |
|
<?php
function buildOptionArray($aArrayValue, $aArrayDisplay, $sCompare = '') {
$iArray = count($aArrayValue);
$sOutput = '';
for ($i = 0; $i < $iArray; $i++) {
$sOutput .= '<option value="' . $aArrayValue[$i] . '"' . ($aArrayValue[$i] == $sCompare ? ' selected="selected"' : '') . '>' . $aArrayDisplay[$i] . '</option>'."\n";
}
return $sOutput;
}
$aLevels = array(
0 => 'Banned',
1 => 'Member',
2 => 'Moderator',
3 => 'Tutorial Staff',
4 => 'Admin'
);
?>
<div class="l">Level</div>
<div class="r">
<select name="level" size="1">
<?= buildOptionArray(array_keys($aLevels), array_values($aLevels), $arr['level']); ?>
</select>
</div>
</div>
<?php function buildOptionArray($aArrayValue, $aArrayDisplay, $sCompare = '') { $iArray = count($aArrayValue); $sOutput = ''; for ($i = 0; $i < $iArray; $i++) { $sOutput .= '<option value="' . $aArrayValue[$i] . '"' . ($aArrayValue[$i] == $sCompare ? ' selected="selected"' : '') . '>' . $aArrayDisplay[$i] . '</option>'."\n"; } return $sOutput; } 0 => 'Banned', 1 => 'Member', 2 => 'Moderator', 3 => 'Tutorial Staff', 4 => 'Admin' ); ?> <div class="l">Level</div> <div class="r"> <select name="level" size="1"> </select> </div> </div>
|