下拉框选中后默认为选中状态
<td ><select id="pri_sel_'.$v['id'].'"> <option value="1">随机</option>'; if($v['rid']){ $selete = ''; foreach($prizelist as $key=>$val){ if($v['rid'] == $val['id']){ $selete = 'selected'; }else{ $selete = ''; } echo ' <option value="'.$val['id'].'" '.$selete.' >'.$val['pname'].'</option>'; } }else{ foreach($prizelist as $key=>$val){ echo '<option value="'.$val['id'].'">'.$val['pname'].'</option>'; } } echo '</select></td>