function validRelativePath($path) { $dirs = $this->getDirs(); if ($path == '/') { return true; } //check the path given in the url against the //list of paths in the system. for ($i = 0; $i < count($dirs); $i++) { $key = key($dirs); //we found the path if ($key == $path) { return true; } next($dirs); } return false; }