Last active
August 29, 2015 14:23
-
-
Save softsolution/62ba0450466b8a6383a9 to your computer and use it in GitHub Desktop.
Перегруппировка многомерного массива
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cats_full = $model->getCategories(); | |
if(!$cats_full) { return false; } | |
foreach ($cats_full as $cat) { | |
$cats[] = $cat; | |
$nsl[] = $cat['NSLeft']; | |
$ord[] = $cat['ordering']; | |
} | |
array_multisort($nsl, SORT_ASC, $ord, SORT_ASC, $cats); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment