Skip to content

Instantly share code, notes, and snippets.

@jakemcgraw
Created November 29, 2012 19:00
Show Gist options
  • Save jakemcgraw/4171130 to your computer and use it in GitHub Desktop.
Save jakemcgraw/4171130 to your computer and use it in GitHub Desktop.
MY GOD, IT'S FULL OF array_* calls
<?php
return array_combine(array_keys($resp), array_map(function($children, $category_id) {
return array_filter($children, function($category) use ($category_id) {
return ($category_id == $category['parent_id'] &&
strpos($category['name'], 'In Nav') === false);
});
}, $resp, array_keys($resp)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment