Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //which of this is faster...
- // sort as you go
- $children = array();
- // its been requested that thes go in alphabetical order
- foreach($tree['children'] as $id => $family){
- $family['id'] = $id;
- $children[$family['name']] = $family;
- ksort($children);
- }
- // OR
- // sort at the end
- $children = array();
- // its been requested that thes go in alphabetical order
- foreach($tree['children'] as $id => $family){
- $family['id'] = $id;
- $children[$family['name']] = $family;
- }
- ksort($children)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement