Reputation: 15
What is the
DIRECTORY_SEPARATOR
constant contain?
I can't find anything on google explaining this but its used in my OOP book.
Upvotes: 0
Views: 84
Reputation: 101533
It's sort of on the tin.
When I run
var_dump(DIRECTORY_SEPARATOR);
I get (on my Linux/Ubuntu box)
string(1) "/"
(A forward slash). This is the separator string that applies to file paths on the OS your server is running on. It will most probably be a \
(backslash) on Windows systems.
Upvotes: 0
Reputation: 2674
It is the separator that link folder in a path like "/" in :
here/is/my/path
The separator depends on which OS you are running your website.
On windows, this is "\" :
my\path\to\folder
On Unix it's "/"
Upvotes: 2
Reputation: 958
Either '/' or '\' depending on your OS. Use it when specifying paths to make code more portable between Unix-y systems and Windows.
Upvotes: 1