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

removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0m

the problem with str_replace
$str="hahahahahahahahahahahahahaha";
$nn=1;
$str=str_replace('ha','MyGod',$str,$nn);

How a counter of users ? such as ---> (231 Viewing)
I want to count how many users are actually viewing the page, How is that possible?
Thank you guy

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

How to separate records and ORDER BY
Let say i have 100 records and displayed in one page, then i want to get the records from 50-100 and

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

Image loading
Hi Developers,

I'm trying to display an image from images/image.gif getting the url from mysq

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

Sequre login with cookies.
I want to build secure login with cookies. I just want your ideas about this, your suggestions. What

Class not found error
I am getting Class 'index' not found in Eval function:

//write config

$pat

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