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

Customizing message/behavior
Hi,I'm using the ASP.NET membership/authorization controls in my application. Some parts of my appli

Error in Configure System Landscape Directory phase
Hi

We are getting the error in Configure SLD phase ( 41 of 44 phase).

Please f

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

Help with translating C code into assembler code
Hi im doing a project that moves a robot around a maze avoiding walls and need some help with conver

do while conditions
i want to display 6 images in a 2x3 table
now what would be the correct logic to
count that th

Number Format
Hi All,

I have number '000000000050085' I want to format it to 500.85 Can any one give me

Delete Client 066 Earlywatch
Hi all,

in former times client earlywatch was required for SAPs remote access to SAP inst

Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so

Calculating n! using vector
#include
#include
#include

using

Displaying Multidimensional Arrays...about to put my head in a vice, PLEASE HELP
I am fairly new to PHP and MySQL and I have a problem which I have been trying to resolve for days.

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