Do you think it is preferred to use $_SERVER['DOCUMENT_ROOT'] in website’s include statements? Is it supported everywhere without any problem?
Do you think it is preferred to use $_SERVER[‘DOCUMENT_ROOT’] in website’s include statements? Is
Share
Many frameworks use
dirname(__FILE__)to work out the application path based on a known file, usually the index.phpIn the Zend Framework, they use the following to define the application path, which is then used everywhere in the app: