\n EOT; foreach(explode(' ', $resolutions) as $k=>$v) { $className = ($k === 0) ? ' class="active"' : ''; echo <<< EOT \n EOT; } echo <<< EOT \n
EOT; $first = true; foreach(explode(' ', $resolutions) as $k=>$v) { $checked = ($first) ? ' checked' : ''; list($w, $h) = explode('x', $v); echo <<< EOT \n EOT; $first = false; } ?>