quick fix | July 16th, 2012

Hoe to get folder name from current page

Use this function

function getCurrentDirectory() {
$path = dirname($_SERVER[‘PHP_SELF’]);
$position = strpos($path,’/’) + 1;
return substr($path,$position);
}

 

echo getCurrentDirectory();

There are no comments yet, add one below.

Leave a Comment


You must be logged in to post a comment.