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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:43:24+00:00 2026-06-04T20:43:24+00:00

I need to generate an html code of a list of 10 open days

  • 0

I need to generate an html code of a list of 10 open days following the current day, by open days I mean business days (m,t,w,t and f), I’m using the following function to translate the date to french:

function f_date() {
    $temps = time();
    $jours = array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi');
    $jours_numero = date('w', $temps);
    $jours_complet = $jours[$jours_numero];
    $NumeroDuJour = date('d', $temps);
    $mois = array(' ', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');
    $mois_numero = date("n", $temps);
    $mois_complet = $mois[$mois_numero];
    $an = date('Y', $temps);
    $fr_temps = "$jours_complet, $NumeroDuJour $mois_complet $an";
    return "$fr_temps";
}
echo "<br/>".f_date();

And i want to generate the following result:

<select name="ladate">
    <option selected="selected" value="Mardi, 29 mai 2012">29 mai 2012</option>
    <option value="Mercredi, 30 mai 2012">30 mai 2012</option></select>
    ....
    <option value="Vendredi, 15 juin 2012">15 juin 2012</option></select>
</select>

Please tell me if you need further information.

Thank you.

  • 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-04T20:43:26+00:00Added an answer on June 4, 2026 at 8:43 pm

    Just create a loop, increase the days up to ten and ignore all non open days (Sat, Sun). date('N') is your friend to detect the weekday of a given date.

    <?php
    $i = $openDay = 0;
    while($openDay < 10) {
      $i++;
      $time = strtotime('+'.$i.' days');
      $day = date('N', $time);
    
      if ($day == 6 or $day == 7) { // ignore Saturdays and Sundays
        continue;
      }
    
      echo f_date($time).'<br>';
      $openDay++;
    }
    

    You also have to modify your date_f() function to use $temps as parameter.

    <?php
    function f_date($temps = null) {
      // $temps = time();
      // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using StringTemplate V4 to generate some HTML code in my project. I need
I have an html file and i need to generate a list of all
I need a way in PHP/HTML to generate a list from 1 to 100
I need generate action links outside controllers. I can use Html.Action in Views, Url.Action
I have this in my controller. I need my view to generate some HTML,
I need to parse through a CMS generated HTML page and add list item
Let me brief you the whole requirement first. I have the following HTML code:
I've got the following bit of code that generates a list I'm trying to
I have a list generated with PHP that looks like the HTML code below.
Hi, I am using ASP.NET MVC 3 and I need to generate a URL

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.