Depending on whether I'm deploying my website to Linux or Windows, I set my include paths like this: -
if(PHP_OS==="WINNT")
include("..\\library\\chopper.inc");
else
include("/home/site/wwwroot/library/chopper.inc");
I'm sure this isnt the best way to do this!
Whats the correct way of setting the paths depending upon the environment?
you could try to use PHP's predefined constant DIRECTORY_SEPARATOR which gives you an OS-specific directory delimiter. DIRECTORY_SEPARATOR separates the directories within the path: In Windows '' In other systems'/'