jcjst21 Posted August 11, 2011 Share Posted August 11, 2011 Hello, I have a list of people that have to have their medications on certain days of the week... I would like to use PHP to get the current date but extract what day it is, like Monday, Tuesday, wednesday, etc... How I have the medication schedule setup is 7 different checkbox fields, where each field is a day of the week. If for instance someone takes a medication on a Wednesday, a "1" is entered into the table. I want to be able to get the current day of the week to match up with the fields for that specific day.. any suggestions would be great. jcjst21 Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted August 11, 2011 Share Posted August 11, 2011 <?php echo date('l'); // lower case 'L' // will output 'Thursday' for example ?> Quote Link to comment Share on other sites More sharing options...
jcjst21 Posted August 11, 2011 Author Share Posted August 11, 2011 ok so if I place that into a variable...like $today=date("l"; the variable will hold "Thursday?" so if I want to match the data field Thursday which would be like If($thursday==$today && $thursday==1) { then this person takes their medicine today } or do I need to use a string compare? Quote Link to comment Share on other sites More sharing options...
iStriide Posted August 11, 2011 Share Posted August 11, 2011 I'm pretty sure you don't need the && $thursday == 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.