Mistři v programování na #hovnokod

PHP #1538

Uplne nejdukladnejsi selected podminka...

<select name="<?=$name?>" <?=$special?>>
<?php foreach($options as $k => $v):?>
<?php $c = empty($option_class)? '' : 'class="'.$name.'_'.$v[$option_class].'"'; $k = empty($value)?$k:$v[$value]; $v = empty($option) ?$v : $v[$option];?>
<option value="<?=$k?>" <?=$c?> <?=($k==$selected || $v==$selected || (is_array($selected) && in_array($k, $selected) || in_array($v, $selected))) ? 'selected="selected"' : '')?>><?=$v?></option>
<?php endforeach?>
</select>

Anonymous,