Jump to content

Remove doublons


mel47
 Share

Recommended Posts

Hi,
I try to code something I've already done in another context, but since field is a text than a page, it seems to doesn't work exactly the same.

  
  foreach ($prize as $awardees) {
       $year = $awardees->year;  //Problem is here; I got many times each year
       echo <h3>{$year}</h3>; //output : 2024 2023 2023

   $allbyYear = wire('pages')->find("has_parent=1153, year=$year");

      foreach ($allbyYear as $winner) {
		 echo $winner->title; // output winner1 winner 2 winner 3 winner 2 winner 3
        }
  }

How I could only have 2024 and 2023?
Thanks
Melanie

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...