Created
August 12, 2008 12:59
-
-
Save patricklewis/5035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_top_directory() | |
{ | |
# get directory structure eg "/music/graduate/concerts" | |
$directoryPath = dirname($_SERVER['PHP_SELF']); | |
# put each directory into an array | |
$directoryArray = explode('/', $directoryPath); | |
# get the top level directory | |
$topDirectory = max($directoryArray); | |
return $topDirectory; | |
} | |
?> | |
<img src="http://omniupdate.cc.binghamton.edu/images/siteLogos/logo-<?= get_top_directory(); ?>.gif" alt="Binghamton University, State University of New York" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment