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
Did you know?Explore Trending and Topic pages for more stories like this.
$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

To add a field on the screen XK02.
Hi All,

How to add an additional field in the vendor change control screen XK02.
The

Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

update the selected existing records of database
Hi frndz,
I am new to php and get stuck....

Edit.php > Update.php > Updatea

How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons

Retreiving objects from Sessions
Hi all,

I am getting really frustrated with storing and retreiving objects from a session. Bu

How to add advertisment on top of videos
Hello,
I was told that i should find the answer for this problem in this forums.
I searched a

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or

Database 'Validation'
Hi everyone,
I'm trying to validate the password entered by the user with the password in the dat

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