Day of week


Posted on 16th Feb 2014 07:03 pm by admin

I am using PHP version 5.0.5
I have a varaible ($DATE (date format yyyy-mm-dd)) that is being incremented to populate a table with each day of the month. I am then trying to get the day of week (preferably an integer) for each date in the month. I have tried both
$DOW = date("w", $Date)
and
$DOW = date("l", $Date)

Using October of this year however $DOW always returns either "3" or "Wednesday". I have checked and the varaible $Date is incrementing correctly. Here is the code snippet:

for ($num = 1; $num <= $Count; $num++) {
if($num < 10)
$SDPart = "0$num";
else
$SDPart = "$num";
$Date = "2009" . "-" . $SDMo . "-" . $SDPart;

$DOW = date("w", $Date);

No comments posted yet

Your Answer:

Login to answer
106 Like 38 Dislike
Previous forums Next forums
Other forums

dropdown box help - open php files to textarea
Hi, I am using tinymce to edit content located in several php files. The code I attached works but i

Require select-option functionality in Module Pool Programming
Hi Gurus,

I am doing a development by Module Pool on Warehouse Management. For that devel

need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working ca

A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
When I am trying to insert WBS element in a project, error occurs:

"A WBS eleme

Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,

The code below works great. It creates a table that shows the 25 most recently added t

dynamic table with forms
I have a table that is populated with mysql data and in teh first column there is a raido button tha

cookie problem
I hv a website url
In this site main menu functionality based on cookie when user click on parti

Weird problem with SELECT command..Help!
Hi!

It seems I'm having a really weird problem with SQL SELECT command....I have table into a

Move array index to end
Hey guys,
Quick question:

I have an array that looks like this:
Code: [Select]$var =

Big Problem!! Please help
Hi Guys,

Im making a website for a friend have encountered a really annoying problem. When ev

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash