Jump to content
bubbles

PHP Array Sort

Recommended Posts

Posted (edited)

Am un array sub forma :


Array (
[28] => Array (
[nr] => 1
[pauza] => 2
[maxim] => 3
[aparitie] => 4 )

[29] => Array (
[nr] => 5
[pauza] => 6
[maxim] => 7
[aparitie] => 8 )

)

Cum pot sa sortez valorile ascending de exemplu dupa [maxim] ?

Edited by bubbles
Posted

$rst[] = array('ceva' => 'da', 'altceva' => 1);
$rst[] = array('ceva' => 'nu', 'altceva' => 2);
$rst[] = array('ceva' => 'nu', 'altceva' => 3);
foreach($rst as $k => $v) {
$r[$k] = $v['altceva'];
}
array_multisort($r, SORT_ASC, $rst);
print_r($rst);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...