public function cleanPath($path) { // Check to see if it begins in a slash if (substr($path, 0) != '/') { $path = '/' . $path; } // Check to see if it ends in a slash if (substr($path, -1) != '/') { $path .= '/'; } return $path; }