webpagefxjared

question...

Sep 14th, 2011
582
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. //which of this is faster...
  4.  
  5. // sort as you go
  6.  $children = array();
  7.   // its been requested that thes go in alphabetical order
  8.   foreach($tree['children'] as $id => $family){
  9.     $family['id'] = $id;
  10.     $children[$family['name']] = $family;
  11.     ksort($children);
  12.   }
  13.  
  14.  
  15. // OR
  16.  
  17. // sort at the end
  18.  
  19.  $children = array();
  20.   // its been requested that thes go in alphabetical order
  21.   foreach($tree['children'] as $id => $family){
  22.     $family['id'] = $id;
  23.     $children[$family['name']] = $family;
  24.   }
  25.   ksort($children)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×