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

Values disappear from my array :( HELP!
hey all, I have a lil mysql/php/apache script that queries a database
and pulls put 5 integers.

Problem assigning value to variable in "IF" function
Does this script makes sense? I am trying to take the value that is set to "authenticat" a

Specific name typed, specific image shown on html page
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Not loading image
When this function gets loaded it doesn't load the image just trying to figure out why.

Code:

noob question
i traying to do a php form with auto replay for both(me and the user who send me a mail),

a u

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

Parse XML
Good day,

I use oempro software and try to parse XMLReturn but it's not working for me, simpl

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

Unifying logins of two different scripts
I have two different game scripts which I want to embed on my own site. The problem is I don't want

Get to know your fellow coder
I think it's time we got personal around here. There's a lot of code swapping and a few members kno

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