1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Sort values in yaml

Discussion in 'Development' started by minijaham, Aug 5, 2021.

  1. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Code:
    groupA:
      James:
        gpa: 3
        age: 13
      Charles:
        gpa: 4
        age: 15
      John:
        gpa: 2
        age: 17
    
    I want to get each person's "age" and sort it from greatest to least.
    So it prints out to something like this:
    Code:
    1. John
    2. Charles
    3. James
    
    I also want to be able to get what place the person is. For example, let's say there is a function to get the person's place.
    If I do
    PHP:
    getPlace("John");
    This will print "1"
     
    Last edited: Aug 5, 2021
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    Last edited: Aug 5, 2021
    minijaham likes this.
  3. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Agent and Primus like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.