Return to Snippet

Revision: 26994
at May 18, 2010 14:12 by Mikaye


Initial Code
function Path($file) {
    if(file_exists($file)) {
        return "./$file";
    }else {
        $Path="..";
        while(true) {
            if(file_exists($Path.'/'.$file)) return $Path."/$file";
            $Path.="/..";
        }
    }
    
}

Initial URL


Initial Description


Initial Title
Find relative path to a specific file

Initial Tags
path

Initial Language
PHP