Jump to content

Get day of the week with PHP


jcjst21

Recommended Posts

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

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?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.