Hi,
I have a file called index.php, I wish to get the name of the parent folder,
Any ideas on how to go about this,
Many Thanks
Chris
Find out the name of the parent folder
Moderator: General Moderators
- seppo0010
- Forum Commoner
- Posts: 47
- Joined: Wed Oct 24, 2007 4:13 pm
- Location: Buenos Aires, Argentina
Code: Select all
<?php
echo dirname(__FILE__); //current directory
echo dirname(dirname(__FILE__)); //parent directory
?>- seppo0010
- Forum Commoner
- Posts: 47
- Joined: Wed Oct 24, 2007 4:13 pm
- Location: Buenos Aires, Argentina
ups, sorry...
Code: Select all
echo basename(dirname(dirname(__FILE__)));