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

PHP Display Telephone Number On Referrer
I have used the php below to show a different telephone number in the header of the site depending u

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

Deleted Delivery but material wont return
We deleted a delivery but the material its still pending.

We made a reverse goods movemen

PHP / MySQL Associative Multidimensional Array:
Hello.

I have data in a MySQL Table that adheres to the below: (note, no index, could add if

listing help
Hi,

at first, great new design!!! I like it,

i got a problem,

I want to list so

Output Full URL of Current Page
Let's say I am currently viewing a dynamic page:

http://www.mydomain.com/directory/index.php

Multiple WHILE loops help
Hi there. I'm writing an application that is pulling and displaying results for real estate listing

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

pass form variables straight to email, no database required?
hello all,

im working on this form...

http://www.adobedayevents.com/project_request/pr

How to show more than 1 users with this code...
Hello,
i have a table that shows users only if I, as Administrator, want to be shown. But its sho

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