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 7745029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:54:41+00:00 2026-06-01T09:54:41+00:00

I have start date and end date. I also have particular day i.e. wednesday.

  • 0

I have start date and end date.
I also have particular day i.e. wednesday.

Now i want to show date of every wednesday between start date and end date.

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-01T09:54:42+00:00Added an answer on June 1, 2026 at 9:54 am

    Try this:

    function getAllWednesday($from_date, $to_date){
        // getting number of days between two date range.
        $number_of_days = count_days(strtotime($from_date),strtotime($to_date));
    
        for($i = 1; $i<=$number_of_days; $i++){
            $day = Date('l',mktime(0,0,0,date('m'),date('d')+$i,date('y')));
            if($day == 'wednesday'){
                echo Date('d-m-Y',mktime(0,0,0,date('m'),date('d')+$i,date('y'))),'<br/>';
            }
        }
    }
    

    The count_days() function

    function count_days( $a, $b )
    {
        // First we need to break these dates into their constituent parts:
        $gd_a = getdate( $a );
        $gd_b = getdate( $b );
        // Now recreate these timestamps, based upon noon on each day
        // The specific time doesn't matter but it must be the same each day
        $a_new = mktime( 12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year'] );
        $b_new = mktime( 12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year'] );
        // Subtract these two numbers and divide by the number of seconds in a
        // day. Round the result since crossing over a daylight savings time
        // barrier will cause this time to be off by an hour or two.
        return round( abs( $a_new - $b_new ) / 86400 );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have start date and end date. I need to find out the day
I have a start date and end date field. Both has seperate ajax calender
I'm using the jQuery datepicker where I have two textboxes (start date / end
I have two date entities, start_date and end_date and now I want to find
I have 2 sets of input boxes: 1) Start Date I and End Date
I have two datepickers. When start date is selected, end date is automatically assigned
In MySQL, If I have a list of date ranges (range-start and range-end). e.g.
I have two dates - a start date and an end date. I need
In my SSRS report, I have a start date and an end date as
Have a form where a user can enter start date/time and end date/time for

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.