Skip to content

Instantly share code, notes, and snippets.

@tml
Forked from MarkyC/php-if-increment.html
Last active December 11, 2015 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tml/4562217 to your computer and use it in GitHub Desktop.
Save tml/4562217 to your computer and use it in GitHub Desktop.
<div class="input-prepend">
<span class="add-on">Day: </span
<select name="day" id="day" class="input-block-level">
<!-- 1 = Sunday ... -->
<!-- somewhere in a common location in your code: $days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); -->
<?php foreach($days as $d=>$n): ?>
<option value="<?php echo $d;?>" <?php if ($d == $col) echo 'selected="selected"'; ?>><?php echo $n?></option>
<?php endforeach; ?>
</select>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment