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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:56:44+00:00 2026-05-24T01:56:44+00:00

<?php while($show = $grabAlbums->fetch() ){ $date_headers_array[date(‘m’, $show[date])][date(‘d’, $show[date])][] = $show; } foreach ($date_headers_array as

  • 0
<?php
        while($show = $grabAlbums->fetch() ){
            $date_headers_array[date('m', $show["date"])][date('d', $show["date"])][] = $show;
        }

foreach ($date_headers_array as $month => $v1) {
    foreach ($v1 as $day => $v2) {
    ?>
<h3 class="EventlistHeader" style="margin-bottom: 4px;">
    <?php 
    echo htmlentities(ucfirst(strftime("%A", $v2[0]['date'])))." ";
    echo $day.". ".strftime('%B', $v2[0]['date']); 
    ?>
</h3>
<?php
foreach ($v2 as $album) {
echo $album["content"] "<br>";
}
?>

This is making a h3 header for each day that exists in $show[“date”]

What i am looking for to do is to show header per month instead.

It shows like this now:

**Tuesday 12 july:**
content
**Wednesday 13 july:**
content
**Thursday 28 july:**
content

I want it to show like this:

**July**
12th, content
13th, content
28th, content

** is the h3 header

how can i do this?

  • 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-05-24T01:56:44+00:00Added an answer on May 24, 2026 at 1:56 am
    foreach ($date_headers_array as $month => $v1) {
        echo "<h3>$month</h3>";
        foreach ($v1 as $day => $v2) {
           echo "$day, ";
        ...
    

    I will leave the changing 1-12 with jan-dec, and adding the st,nd,th to you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?php $i = 0; while(conditionals...) { if($i == 0) print <p>Show this once</p>; print
How do I show loading text in PHP while code (like a massive database
PHP/HTML <select id=n name=userListingCateory> <option disabled=disabled>Category...</option> <?php while($row = $sth2->fetch(PDO::FETCH_ASSOC)) {echo <option value=. $row['catID']
I need to do a PHP while loop, but only if a variable is
<?php $i = 1; $y = 5; ?> <?php while (have_posts()) : the_post(); ?>
Is it possible to do a simple count(*) query in a PHP script while
After using PHP for a while now, I've noticed that not all built-in PHP
i just got some more questions while learning PHP, does php implement any built
a while ago i could comment any code in php with netbeans like this:
Been using PHP/MySQL for a little while now, and I'm wondering if there are

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.