if ( $dh = opendir($nav) ) { while ( false !== ( $file = readdir($dh) ) )
sometimes $nav is empty, when it's empty i need to read the current dir, where the script is executed.
how?
$nav = (!empty($nav))?$nav:getcwd(); /* basically this represents if (!empty($nav)) { $nav = $nav; } else { $nav = getcwd(); //get the current working directory } */ if ( $dh = opendir($nav) ) { while (false !== ($file=readdir($dh))) }
thank you! but now i need a way to get the URL path without the name of the current page at the end