jarvis Posted January 11 Share Posted January 11 Good morning, I'm hoping someone can please kindly help. I have an array of data: $attendees = array( 'course'=> $course_title, 'date' => $course_start_date, 'name' => $order->get_billing_first_name().' '.$order->get_billing_last_name(), 'email' => $order->get_billing_email(), 'phone' => $order->get_billing_phone(), 'qty' => $result['quantity'], 'order' => $order_id_number ); I then group the data: // group data by course $result = array(); foreach ($attendees as $attendee): $result[$attendee['course']] = $attendee; endforeach; Using a foreach loop (foreach ($result as $itemName => $rows):) I output the data. This works fine. However, the order isn't right. I'd like to sort the output by alphapetical. So I added the following before the foreach: sort($result); However, it doesn't make a jot of difference. Have I missed something really obvious as to why its not working? Thanks Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.