useCase useCase - 2 months ago 8
PHP Question

How can I define the DIRECTORY_SEPARATOR for both Windows and Linux platforms?

Now I create a small PHP Application, here I have problem for using file path, because in Windows use this type location

but in
Linux /www/app/index
so when I define the path using this
but when the application run in window machine it should be problem for this

So here I want to define the DIRECTORY_SEPARATOR both Windows and Linux platform.


PHP accepts both \ and / as valid path separators in all OS. So just use / in your code