Home > Article > Backend Development > Is the directory separator in PHP really unnecessary?
Windows accepts / and
*unix systems accept /
If we use / uniformly, there is no need to use directory separator
See two articles saying it’s unnecessary:
http://alanhogan.com/tips/php...
http://us2.php.net/manual/en/...
Confirm, is it really unnecessary?
Windows accepts / and
*unix systems accept /
If we use / uniformly, there is no need to use directory separator
See two articles saying it’s unnecessary:
http://alanhogan.com/tips/php...
http://us2.php.net/manual/en/...
Confirm, is it really unnecessary?
Anyway, the paths I encountered are all unified/, and I haven’t found any problems so far
I don’t think it’s necessary. PHP_EOL
is still useful. I don’t know what is the purpose of defining a DS
for each project. .
Here is a reason that sounds reasonable: This is a good coding habit, just like writing <?php
even if the short tag is enabled.
At the end of the first article you gave, you mentioned that when you need to use the explode function to split the path, you need this DS