i change the dir to the current file directory to :
But how do i change it back to the base director like
/ in linux and say
C: in windows i dont know that is the OS of the user.
Is there a way to do it in both linux and win ?
PHP will translate directory separators for you, so just
chdir('/') will work on both. However, you'd have to account for Windows drive names, as there's no such thing on Unix systems.
The answer to this question: How to get the OS on which PHP is running? might help you determine the OS.