Skip to content

Instantly share code, notes, and snippets.

@Stanton
Created August 24, 2011 09:58
Show Gist options
  • Save Stanton/1167702 to your computer and use it in GitHub Desktop.
Save Stanton/1167702 to your computer and use it in GitHub Desktop.
Just for funzies
<?php
// Now this is a story, all about how my $dirTree got flipped-turned upside down
$reversed_dirTree = array_reverse($dirTree);
// and I'd like to take a minute, just sit right there, I'll tell you how loop the object to get the default category down there.
foreach ($reversed_dirTree as $dirTree_category) {
if (in_array($dirTree_category->name, $directory_category_names)) {
$parent_cat_name = $dirTree_category->name;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment