Re: basename unix/windows

From: Date: Thu, 25 Apr 2002 14:03:44 +0000
Subject: Re: basename unix/windows
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94561@lists.php.net to get a copy of this message
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 to use this particular code on a Unix-style path with an escaped character or space, such as this: /home/eprice/includes/php\ scripts/script.php Of course, it's very rare to see the above, but should be a consideration. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#94561) next »