Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:35:01+00:00 2026-05-26T10:35:01+00:00

How can I write a functional to alphabetize a multidimensional array such that the

  • 0

How can I write a functional to alphabetize a multidimensional array such that the first sort is by ‘building name’ then ‘last_name’, then ‘first_name’

 [70] => 
  Array ( 
    [id] => 635
    [name] => Mick Kruzic 
    [dob] => 11/05/1968 
    [building_name] => 
    [department] => 
    [phone_ext] => 
    [team_name] => 
    [team_leader] => 
    [party_registered] => 
    [total_points] => 0 
    [total_tickets] => 0 
    [awarded_prizes] => 0 
    [processing_prizes] => 0 
    )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:35:02+00:00Added an answer on May 26, 2026 at 10:35 am

    The function you want to look into is array_multisort(). http://php.net/manual/en/function.array-multisort.php
    You can use it to sort a multi dimensional array, or sort several arrays together.
    Make an array of just the keys you wish to sort by then use that array as the second parameter.

    so for example if you whole array was $data:

    foreach($data as $smallarray) $buildingnames[] = $smallarray['building_name'];
    foreach($data as $smallarray) $lastnames[] = $smallarray['last_name'];
    foreach($data as $smallarray) $firstnames[] = $smallarray['first_name'];
    array_multisort($builingnames, ASC, $firstnames, ASC, $lastnames, ASC, $data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I write a function that accepts a variable number of arguments? Is
How can I write a wrapper that can wrap any function and can be
How do I write a function that can accept unlimited number of parameters? What
In many scripts that I write, I often construct programs in a functional style.
How can I write a function which will return pi (π) to a given
In C++, on Linux, how can I write a function to return a temporary
How can I write a C++ function returning true if a real number is
So I know I can write my own HTML-encoding function like this: function getHTMLEncode(t)
How can I write an Emacs Lisp function to find all hrefs in an
I want to write a function which can validate a given value (passed as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.