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
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?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.