irm/include/functions.php
/** Return a series of <option value="x">label</option> type lines
 * $opts is an assoc. array of value => label pairs.  If $selected is
 * given, it should be a scalar containing the value (not label!) you
 * want to be marked as 'selected' in the option set.
 */
Return a series of label type lines
$opts is an assoc. array of value => label pairs.  If $selected is
given, it should be a scalar containing the value (not label!) you
want to be marked as 'selected' in the option set.
Return a series of label type lines $opts is an assoc . array of value = > label pairs . If $selected is given it should be a scalar containing the value ( not label! ) you want to be marked as ' selected ' in the option set .
function select_options($opts, $selected = NULL)
{
	$rv = '';
	foreach ($opts as $v => $l)
	{
		if ($v == $selected)
		{
			$sel = ' selected';
		} else {
			$sel = '';
		}
		$rv .= "<option value=\"$v\"$sel>$l</option>\n";
	}
	return $rv;
}
function select_options ( $ opts , $ selected = NULL ) { $ rv = '' ; foreach ( $ opts as $ v => $ l ) { if ( $ v == $ selected ) { $ sel = ' selected' ; } else { $ sel = '' ; } $ rv .= " <option value= \" $ v \" $ sel > $ l </option> \n " ; } return $ rv ; }
Return a series of <option value="x">label</option> type lines
 $opts is an assoc.
Return a series of <option value = " x " > label< / option > type lines $opts is an assoc .