Skip to content

Instantly share code, notes, and snippets.

@Pierozi
Created January 8, 2016 11:07
Show Gist options
  • Save Pierozi/e1abdaa854cba292cabd to your computer and use it in GitHub Desktop.
Save Pierozi/e1abdaa854cba292cabd to your computer and use it in GitHub Desktop.
dirname-recursive
<?php
$dir = __DIR__;
do {
echo $dir, "\n";
$dirParent = dirname($dir);
if ($dir === $dirParent) {
break;
}
$dir = $dirParent;
} while(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment