RE: [PHP] basename unix/windows
| From: | Matt Friedman | Date: | Thu, 25 Apr 2002 13:54:36 +0000 |
| Subject: | RE: [PHP] basename unix/windows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94557@lists.php.net to get a copy of this message | ||
Replace the "\" with "/" using str_replace or some such function before
using basename. Windows will handle either kind of path. Linux does not
know the "\" as a file path separator. It only knows "/"
Matt Friedman
Web Applications Developer
www.SpryNewMedia.com
-----Original Message-----
From: ROBERT MCPEAK [mailto:RMCPEAK@jhuccp.org]
Sent: Thursday April 25, 2002 9:41 AM
To: php-general@lists.php.net
Subject: [PHP] basename unix/windows
I'm running php on linux and wish to use basename() to get the file name
from a windows path.
basename() on our linux/php box can't seem to cope with the use of
backslash (\) in the Windows paths I'm feeding it.
In other words:
basename(/usr/blah/doh/yuck/wow/abigfile.html)
resolves to : abigfile.html
but
basename(adirectory\onawindowsbox\abigfile.html)
does not resovle to abigfile.html.
Does anybody have a workaround for this?
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php