TomTees Posted November 27, 2010 Share Posted November 27, 2010 What does this code mean with respect to the file path?? include ('./includes/header.html'); TomTees Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/ Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2010 Share Posted November 27, 2010 The dot means current directory. So that would read "the header.html file, which is in the includes directory, which is in the current directory". Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140144 Share on other sites More sharing options...
TomTees Posted November 27, 2010 Author Share Posted November 27, 2010 The dot means current directory. So that would read "the header.html file, which is in the includes directory, which is in the current directory". So how is that different than... include ('includes/header.html'); TomTees Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140149 Share on other sites More sharing options...
trq Posted November 27, 2010 Share Posted November 27, 2010 Its not. Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140151 Share on other sites More sharing options...
TomTees Posted November 27, 2010 Author Share Posted November 27, 2010 Its not. Hmmm... Interesting... Well, I like my way better for brevity's sake. (But I did learn a new way to say the same thing...) Thanks, TomTees Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140153 Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2010 Share Posted November 27, 2010 In that context it isn't, really. There may be a specific reason to use it in certain instances, but if there is, I'm not aware of it, (except on the command line). Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140155 Share on other sites More sharing options...
trq Posted November 27, 2010 Share Posted November 27, 2010 Well, to be precise, the one starting with ./ is an absolute path and the other is relative. They both however point to the same location. ps: These have nothing to do with php per say either. The are part of your OS's file system. Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140159 Share on other sites More sharing options...
TomTees Posted November 27, 2010 Author Share Posted November 27, 2010 Well, to be precise, the one starting with ./ is an absolute path and the other is relative. They both however point to the same location. ps: These have nothing to do with php per say either. The are part of your OS's file system. Okay. So, back to an earlier thread... How would I say, "The current directory."?? How would I say, "The Web Root."?? TomTees Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140183 Share on other sites More sharing options...
trq Posted November 27, 2010 Share Posted November 27, 2010 How would I say, "The current directory."?? ./ How would I say, "The Web Root."?? $_SERVER['DOCUMENT_ROOT'] Link to comment https://forums.phpfreaks.com/topic/219958-help-with-file-path-syntax/#findComment-1140187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.