Jump to content

Linux/Windows Directory Paths


JREAM

Recommended Posts

I recently re-installed WAMP, and im not sure why this is happening..

DEFINE('root', dirname(__FILE__). '/');
echo root;

Outputs: C:\Workspace\project_1/files/

 

Previously it would list like:

http://workspace/project_1/files/

 

According to my localhost it's in.

 

Does anyone know why this is?

Link to comment
https://forums.phpfreaks.com/topic/189263-linuxwindows-directory-paths/
Share on other sites

I doubt seriously it ever included http:// ... __FILE__ is suppossed to be the "The full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP 4.0.2, __FILE__ always contains an absolute path with symlinks resolved whereas in older versions it contained relative path under some circumstances."

 

If you're using this for includes, then it really doesn't matter what it is, so long as it resolves correctly.  PHP is suppossed to do the right thing on windows regardless of whether or not the path seperator is "/" or "\"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.