Edward Posted November 14, 2012 Share Posted November 14, 2012 require(dirname(__FILE__).DIRECTORY_SEPARATOR.'controllers'.DIRECTORY_SEPARATOR.$route.'.php'); require(dirname(__FILE__).'/controllers/'.$route.'.php'); I changed some of my code replacing '/' with the DIRECTORY_SEPARATOR constant does anyone else do this or have any views on this kind of coding technique? Link to comment Share on other sites More sharing options...
HartleySan Posted November 14, 2012 Share Posted November 14, 2012 I've heard that PHP can automatically change / to \ and vice versa in order to be compatible with whatever server the script is running on. As such, I always specify just / and go on my merry way. Link to comment Share on other sites More sharing options...
Larry Posted November 14, 2012 Share Posted November 14, 2012 I believe PHP will treat / like \ automatically when appropriate. That being said, I rarely run my code on Windows, so I haven't done heavy testing of it. Link to comment Share on other sites More sharing options...
Recommended Posts