converting day of the week to numerical
Posted 11 October 2006 - 08:47 PM
how can I convert a day into a numerical value?
like monday --> 1 tuesday --> 2 etc
Posted 11 October 2006 - 08:57 PM
<?php echo date('w'); ?>
so, as with any other date call, pass in a timestamp of the date you want the day of the week for as a second parameter, and you're good to go.
Posted 11 October 2006 - 09:09 PM
var text = main_select.options[main_select.selectedIndex].text.split(" ");
var day = text.toLowerCase();
now I know that by using a switch statement I can change that string to a numerical value but I was wondering if there was a more efficient way of doing it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users