Jump to content

how to deal with upper/lowercase in repeater field ->sort()


cabrooney
 Share

Recommended Posts

I have a repeater field containing a list of pages (each page with people information like first_name, last_name etc.).

When i try to sort and display with foreach(), the sorting puts all lowercase-starting entries at the back after Z...

My Script:

foreach ($group->group_people->sort("person_name") as $person){
          echo $person->person_name;
}

Output:

Alberts
Bernard
Constantin 
...
Zachary
van Bergen 

The last Name "van Bergen" is lowercase and is put at the end of the sorting array. Is there a way to sort while ignoring upper/lowercase?
 

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...