[PHP] basename unix/windows

2002-04-25 Thread ROBERT MCPEAK
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 :

Re: [PHP] basename unix/windows

2002-04-25 Thread Alexander Weber
ROBERT MCPEAK wrote: 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? What about str_replace()? -- PHP General Mailing

RE: [PHP] basename unix/windows

2002-04-25 Thread Matt Friedman
MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Thursday April 25, 2002 9:41 AM To: [EMAIL PROTECTED] 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

Re: [PHP] basename unix/windows

2002-04-25 Thread Stuart Dallas
ROBERT MCPEAK [EMAIL PROTECTED] wrote: 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? Convert all \ to /

Re: [PHP] basename unix/windows

2002-04-25 Thread Erik Price
On Thursday, April 25, 2002, at 09:54 AM, Matt Friedman wrote: 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 / Just make sure that you never need