<select name=”Monday_start”><?php $time = ’10:00′; // start ?>
<option value=””>Select time here</option>
<?php for ($i = 0; $i <= 20; $i++)
{
$prev = date(‘g:i a’, strtotime($time)); // format the start time
$next = strtotime(‘+30mins’, strtotime($time)); // add 30 mins
$time = date(‘g:i a’, $next); // format the next time ?>
<option value=”<?php echo $prev; ?>”><?php echo $prev; ?></option>
<?php } ?>
</select>
Change date format
$date = '19:24:15 06/13/2013';
echo date('h:i:s a m/d/Y', strtotime($date));
$date = '19:24:15 06/13/2013';
echo date('h:i:s a m/d/Y', strtotime($date));
HTML elements like “bold”, “italic” etc on textarea using HTML with java script.
<form action=”” name=”myForm” method=”post”>
[ <span class=”intLink” onclick=”insertMetachars(‘<strong>’,’<\/strong>’);”><strong>B</strong></span> | <span class=”intLink” onclick=”insertMetachars(‘<em>’,’<\/em>’);”><em>I</em></span> | <span class=”intLink” onclick=”var newURL=prompt(‘Enter the full URL for the link’);if(newURL){insertMetachars(‘<a href=\u0022’+newURL+’\u0022>’,’<\/a>’);}else{document.myForm.new_subspecify.focus();}”>URL</span>]<br>
<input type=”text” id=”doct_specialty” value=”” name=”new_subspecify”><br>
<input type=”submit” value=”Save” id=”butt_specialty” name=”hosp_services”>
</form>
<script>
function insertMetachars(sStartTag, sEndTag) {
var bDouble = arguments.length > 1, oMsgInput = document.myForm.new_subspecify, nSelStart = oMsgInput.selectionStart, nSelEnd = oMsgInput.selectionEnd, sOldText = oMsgInput.value;
oMsgInput.value = sOldText.substring(0, nSelStart) + (bDouble ? sStartTag + sOldText.substring(nSelStart, nSelEnd) + sEndTag : sStartTag) + sOldText.substring(nSelEnd);
oMsgInput.setSelectionRange(bDouble || nSelStart === nSelEnd ? nSelStart + sStartTag.length : nSelStart, (bDouble ? nSelEnd : nSelStart) + sStartTag.length);
oMsgInput.focus();
}
</script>