vicodin Posted March 6, 2009 Share Posted March 6, 2009 Ok so im trying to make a script that grabs the basename of a file in windows. It will always be run locally on the machine so when i used the function it is messing up. Im guessing it has something to do with the space? Example: $path="C:\Documents and Settings\office\Desktop\Web Design\CSVtoJPG Rename\test.txt"; echo basename($path); Output is: CSVtoJPG Rename est.txt Any help anyone? Link to comment https://forums.phpfreaks.com/topic/148189-basename-not-working-in-windows/ Share on other sites More sharing options...
corbin Posted March 6, 2009 Share Posted March 6, 2009 \ is the escape character in PHP. You need \\. Link to comment https://forums.phpfreaks.com/topic/148189-basename-not-working-in-windows/#findComment-777862 Share on other sites More sharing options...
vicodin Posted March 6, 2009 Author Share Posted March 6, 2009 Not sure what you mean really, are able to possible show me an example? Link to comment https://forums.phpfreaks.com/topic/148189-basename-not-working-in-windows/#findComment-777864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.