Sort fields in a loop alphabetically by first field
-
Hi!
I’m trying to sort a group of fields in a loop alphabetically according to the first field of the loop (a text field).
Here’s my code so far:$fields = $cfs->get('fields'); foreach ($fields as $field) { $name = $field['name']; $text = $field['text']; if (!empty($fields)) { echo '<h4>' . $name . '</h4>'; echo '<div class="text"> ' . $text . '</div>'; } }
I’m not sure how to do this, and I found this question in the forum that might have given me an idea, but the link with the answer is no longer working.
Thank you!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Sort fields in a loop alphabetically by first field’ is closed to new replies.