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

Tracking Unique Clicks
Hi guys and gals,

Basically I have a database which tracks clicks on my outbound links, I do

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

Need a Timecode Class...
Not a Time Stamp, Time Code. Format is a bit different. HH:MM:SS:FF where FF is Frames. I dont re

Problem with an browser game.
Hello,i just joined that great forum and i got php prob,its kinda freaky...anyway i got browser game

Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...

Code: $define_li

Regarding accessing SQL query issued by any user in Oracle 10g
Hi all,
i want to know the queries issued by various users accessing a database...

if description does not contain the following words
Hello everyone,

I am parsing a MS Excel (.xls) file and adding it's content to a mySQL databa

difference between datetimes
($row['totime']-$row['fromtime'])/60

this is giving me 0

example of totime and fromtim

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

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