Please support our PHP advertiser: Lunarpages PHP Web Hosting
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 5
Solved Threads: 2
how do I reverse the direction of a slash? I am trying to reverse the slashes in the directory path of a windows system.
I have tried so many things but then when I actually test it to make sure it works, it always fails, so I decided to try it via brute force. Again this fails because of special symbols, take for example:
[PHP]for ($i=0; $i<strlen($file_dir); $i++)
{
if ($file_dir{$i} == "\\")
{
$file_dir{$i} = "/";
}
}[/PHP]
when I finally tried this method it works wonderfully until I hit some special cases like when I have a folder called:
C:\temp\2004
it turns it into (a tab and some weird symbol in there):
C: emp€4
but I really want it to look like:
C:/temp/2004
I have tried so many things but then when I actually test it to make sure it works, it always fails, so I decided to try it via brute force. Again this fails because of special symbols, take for example:
[PHP]for ($i=0; $i<strlen($file_dir); $i++)
{
if ($file_dir{$i} == "\\")
{
$file_dir{$i} = "/";
}
}[/PHP]
when I finally tried this method it works wonderfully until I hit some special cases like when I have a folder called:
C:\temp\2004
it turns it into (a tab and some weird symbol in there):
C: emp€4
but I really want it to look like:
C:/temp/2004
Similar Threads
Other Threads in the PHP Forum
- plz urgent urgent urgent help plz (PHP)
- another newbie with alot of redhat and apache server Q'S (Linux Servers and Apache)
- How to modify/change a logo on a wallpaper? (Graphics and Multimedia)
- Technology Change (IT Professionals' Lounge)
- Change in Certification Policy NT vs 2000 (Windows NT / 2000 / XP / 2003)
Other Threads in the PHP Forum
- Previous Thread: PHP 5.0.5 Released - Vulnerability Fixes
- Next Thread: PHP .htaccess form
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Threaded Mode