php - How I can find my root directory at the server? -


how can find root directory of website @ server, , how refer file not in same directory in file goes in php?

echo $_server['document_root']; 

the above line give root directory of website

you can directly define path constant somewhere in common includes file like

define('path_to_project_root', '/path/to/projectroot/'); 

and use constant wherever want


Comments