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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:57:25+00:00 2026-06-11T19:57:25+00:00

You can see what I am trying to make here http://perthurbanist.com/website/calendarloader.php . Basically it

  • 0

You can see what I am trying to make here http://perthurbanist.com/website/calendarloader.php. Basically it is a horizontal calendar and you will use arrows to move. What I want to do is have the code display all the months horizontally along with all the days (starting from the current month and day). I know how to get the current day using the date function but I don’t know how to make the calendar start at that date. I also want it to load lots of months (maybe 2-3 years worth). How do I do those two things.

<?php
$showday = date("j");
$displaymonth = date("M");
$showmonth = date("n");
$showyear = date("Y");

$day_count = cal_days_in_month(CAL_GREGORIAN, $showmonth, $showyear);

echo '<ul class="calendarnavigation">';
echo '<li class="month">' . $displaymonth . '</li>';

for($i=1; $i<= $day_count; $i++) {
echo '<li>' . $i . '</li>';
}

echo '</div>';
?>
  • 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-11T19:57:26+00:00Added an answer on June 11, 2026 at 7:57 pm

    If you know (or are able to calculate how far ahead you want to go in days you could try this:

    for($i=0; $i<$numberOfDays; $i++)
    {
        $timestamp=mktime(0,0,0,date("m"),date("d")+$i,date("Y"));
        $day=date("d", $timestamp);
        $month=date("m", $timestamp);
        $year=date("Y", $timestamp);
    
        ...Your display stuff here...
    
    }
    

    On each iteration of the loop the $timestamp will advance one day and using it in your date functions will give you the information about the date that you need to create your display.

    Maybe in your case you can use

    echo '<ul class="calendarnavigation">';
    
    for($i=0; $i<$numberOfDays; $i++)
    {
        $timestamp=mktime(0,0,0,date("m"),date("d")+$i,date("Y"));
        $showday=date("j", $timestamp);
        $displaymonth=date("M", $timestamp);
        $showmonth=date("n", $timestamp);
        $showyear=date("Y", $timestamp);
    
        if($showday=="1")
        {
            echo '<li>'.$displaymonth.'</li>';
        }
    
        echo '<li>'.$showday.'</li>';
    
    }
    
    echo '</ul>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI all. You can see the code right here: http://jsbin.com/egixa5/5/edit . I'm trying to
I'm trying to make the change here: http://fluxbox-wiki.org/index.php?title=Howto_Make_dblclick_titlebar_maximize I am using the current git
basically i have a side by side horizontal menu as you can see here:
I'm trying to make a menu using tags, and you can see it here,
I am trying to make a search query like Youtube. http://www.youtube.com/results?search_query=new+york here is the
I am trying to make a server-client model in which the server can see
As you can see in this jsfiddle , I'm trying to make a toggle
Beginner here trying to get a pipeline working in bash. If somebody can see
Trying not to lose it here. As you can see below I have assigned
Here is my page. http://smartpeopletalkfast.co.uk/pp/shop/baby-essentials Im trying to make it so when you hover

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.