Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8445773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:44:44+00:00 2026-06-10T09:44:44+00:00

I have to generate a report, which will consist data for last week starting

  • 0

I have to generate a report, which will consist data for last week starting from monday (if today is monday, then only display the today’s date and count).
Can I know how can I get the last week dates array(starting from last monday)?
Thanks.

I wrote this, but in this case if last week start date is 31, then the next day becomes 32, which is not possible.

$last_week_date_start = date('Y-m-d', strtotime('last monday')) + 1;

I want a array of dates.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:44:45+00:00Added an answer on June 10, 2026 at 9:44 am

    add inside +1

    for($i=0; $i<6; $i++){
        $last_week_dates[] = date('Y-m-d', strtotime('last monday + '.$i.' day'));
    }
    
    /*
    array(7) {
      [0]=>
      string(10) "2012-08-20"
      [1]=>
      string(10) "2012-08-21"
      [2]=>
      string(10) "2012-08-22"
      [3]=>
      string(10) "2012-08-23"
      [4]=>
      string(10) "2012-08-24"
      [5]=>
      string(10) "2012-08-25"
      [6]=>
      string(10) "2012-08-26"
    }
    */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET website from which the users themselves will generate custom reports
I have a form which will generate a report for mailing. The form opens
I am trying to write a view that will generate a report which displays
I'm doing an Asp.Net application which will, eventually, generate 'on the fly' report with
I have a page which gives user to generate report based on different filters
for the application I am working on I have to generate consolidated report where
I have been trying to generate report as per age differences of different months
I'm trying to generate a report of the activities that users have done within
I have a database of meetings. I can generate a report that sorts the
I have a website where users generate an Excel report using a macro, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.