RE: [PHP-WIN] PATH_TRANSLATED yields \\ instead of \

From: Date: Thu, 13 Jul 2000 19:11:00 +0000
Subject: RE: [PHP-WIN] PATH_TRANSLATED yields \\ instead of \
Groups: php.windows 
Request: Send a blank email to php-windows+get-1067@lists.php.net to get a copy of this message
Andy, That does make sense, but now I can't seem to figure out how to fix it... echo "<small>This page was last modified on " . date( "D m/d/Y", filemtime ($PATH_TRANSLATED) ) . "</small>\n"; I need a function that does something like this I guess... (this first line is not real code(obviously)) $foo = REPLACE_SOME_CHARACTERS_FUNCTION ( "\\\\" , "\\" , $PATH_TRANSLATED); echo "<small>This page was last modified on " . date( "D m/d/Y", filemtime ($foo) ) . "</small>\n"; --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer Licking County, Ohio, USA 740-349-3631 > -----Original Message----- > From: Andy Hoffman [SMTP:andy.hoffman@bms.com] > Sent: Thursday, July 13, 2000 2:43 PM > To: php-windows@lists.php.net > Subject: Re: [PHP-WIN] PATH_TRANSLATED yields \\ instead of \ > > "Asendorf, John" wrote: > > > Has anyone else noticed that $PATH_TRANSLATED returns a path like this: > > > > C:\\wwwroot\\something\\something\\something.php > > > > where are all the slashes coming from? > > The reason for double back-slashes relates back to unix-style strings > (escape sequences). When you have a string value that just has > "C:\somedir\newdir\subdir", you'll notice that embedded in this string (by > unix convention) is the special escape sequence \n for a newline. But > that's not what you wanted. what you wanted was a REAL backslash. Well, > you'll have to escape sequence that too. And the escaped version is \\ > (double back-slash). > > Does that make sense? > > -- > Andy Hoffman > Web Developer > Bristol-Myers Squibb > office: LVL G1.2607 > email: andy.hoffman@bms.com > phone: 609-252-5788 > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#1067) next »