|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-04-03 13:33 UTC] e dot vandeoudeweetering at marcanti dot esprit-sg dot
Description:
------------
When using the function dirname, \ is returned for the root directory /
This is what the documentation says:
//after PHP 4.3.0
dirname('c:/'); // returns 'c:'
Reproduce code:
---------------
print dirname('/');
print dirname('C:/');
print dirname('C:\\'); //this function works
Expected result:
----------------
/
C:
C:\
Actual result:
--------------
\
C:\
C:\
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 11:00:01 2025 UTC |
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. <?php dirname('c:/x'); // returns 'c:\' dirname('c:/Temp/x'); // returns 'c:/Temp' dirname('/x'); // returns '\' ?>