$today = date("w"); // $today will result in '1' $today = date("D"); // $today will result in 'Mon' $today = date("l"); // $today will result in 'Monday'
Now if you wanted to feed the script something like this: $string = "01 Jul 2002"; $today = date("l",strtotime($string)); This will result in the long textual day of '01 Jul 2002', so 'Monday' or if you interchange the "l" in the first part of the date function with "w" you will get the the day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday) or if you use "D" you will get the short textual day so 'Mon' I hope all of that makes sense to you. Check out the php manual for the function date and strtotime. http://www.php.net/date http://www.php.net/strtotime Rick "Trust in the Lord with all your heart, And lean not on your own understanding; In all your ways acknowledge Him, And he shall direct your paths." - Proverbs 3:5-6 > From: "Attila" <[EMAIL PROTECTED]> > Date: Mon, 15 Jul 2002 16:44:39 -0600 > To: [EMAIL PROTECTED] > Subject: [PHP] Date () Help please > > Hello all, > I am very new to PHP and I have added some minor PHP to my website. I > would like to make a PHP calander to keep track of things going on. Could > someone tell me how I can get the first day of every month. > > For Example: > 01 Jul 2002 was a Monday. > 01 Mar 2002 will be a Thursday > > I need the dates to start my tables so they insert the numbers in the right > day. > > Thanks, > Attila > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php