Working with the directory above

Good day Friends!
There is a need to work with a directory that is several levels higher than the one in which my script is located. Look, this is the folder structure:

alt text

From the file_managerfolder, you will need to see the entire contents of the take_testfolder, which will also be the root, the address of the root directory from the file_managerfolder will be “../../../../”. And hence the question: Is it possible, or rather, is there such a function in phplike “cd:”, to “select” a directory for work, and already access its contents relatively, for example: ./setup/or ./system/cache_controll.


Answer 1

Haven’t tried chrootand chdirand . ..?

Added.

Not only that. Here’s the help: Changes the root directory of the current process to the one passed as the strparameter. Returns TRUEon success, FALSEon error.

This function is only available if your operating system supports it and you use the CLI, CGI, or Embed SAPI call methods.