• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 506
  • Last Modified:

PHP Multisort Function

How would I sort this array if I wanted the records with the YEAR_BUILT Sorted Numerically

I would basically like the same sort function as ORDER BY in SQL

Eg:

$property[DETAILS][0][YEAR_BUILT]
$property[DETAILS][0][VALUE]
$property[DETAILS][1][YEAR_BUILT]
$property[DETAILS][1][VALUE]
$property[DETAILS][2][YEAR_BUILT]
$property[DETAILS][2][VALUE]

Is there a way to do this:

array_multisort($property[DETAILS][???][YEAR_BUILT],SORT_NUMERIC,$property);

Notice where the question marks are... Thanks for your time.
0
smoothcat11
Asked:
smoothcat11
  • 2
2 Solutions
 
steelseth12Commented:
smoothcat11 i posted the answer to your previous question
0
 
nizsmoDeveloperCommented:
Yep there's definitely a way, here is the function and heaps of examples:
http://nz.php.net/function.array-multisort
0
 
steelseth12Commented:
Its not that i dont appreciate  the points and the grade. But you should have this question delete as the answer was given in the previous question Q_22902204.html.

You can ask for this question to be deleted in the community support

 http://www.experts-exchange.com/Community_Support/General/

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now