private function get_encoded_path($path) { $parts = explode('/', $path); for ($i = 0; $i < sizeof($parts); $i++) { $parts[$i] = urlencode($parts[$i]); } $enc_path = implode('/', $parts); return str_replace('//', '/', $this->path . $enc_path); }