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 Link to comment https://forums.phpfreaks.com/topic/244462-get-day-of-the-week-with-php/ 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 ?> Link to comment https://forums.phpfreaks.com/topic/244462-get-day-of-the-week-with-php/#findComment-1255645 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? Link to comment https://forums.phpfreaks.com/topic/244462-get-day-of-the-week-with-php/#findComment-1255647 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 Link to comment https://forums.phpfreaks.com/topic/244462-get-day-of-the-week-with-php/#findComment-1255650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.