how to get list of date and name of day between two dates using php

<?php
$start=date('2013-05-02');
$end=date('2013-05-06');
?>

I got out put like following,I don't know how to get this please help me

Thursday 2013-05-02 Friday 2013-05-03 Saturday 2013-05-04 Sunday 2013-05-05 Monday 2013-05-06

Answers


$start    = new DateTime('2013-5-02');
$end      = new DateTime('2013-6-02');
$interval = DateInterval::createFromDateString('1 day');
$period   = new DatePeriod($start, $interval, $end);

foreach ($period as $dt)
{
    echo $dt->format("l Y-m-d");
    echo "<br>";
}

Note[it's support only Above 5.3.0 php version]


Need Your Help

SQL column true or false - use a view?

c# asp.net sql vb.net

Simple question, I have an application and dependant on whether you are in the administration system or on the public website I want to show different results.

When did colspan and rowspan become available for usage in HTML tables?

html table html-table language-history

A co-worker and I are curious about when colspan and rowspan became available for usage in HTML tables.

How to integrate Sphinx-generated Latex code in existing Latex documents?

latex documentation-generation python-sphinx

I've used Sphinx to document a Python library. So far this works great, I get nice HTML and LaTeX output. Concerning Latex, Sphinx generates a complete standalone document with lots of special pack...