back slashes
| From: | Daniel Baughman | Date: | Fri, 08 Jul 2005 20:48:51 +0000 |
| Subject: | back slashes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-218368@lists.php.net to get a copy of this message | ||
Hello all,
Im attempting to insert a windows path into a mysql database via PHP, but
it keeps ineterpreting the backslashes as escape chars.
Lets say I have a string:
"c:\www\test"
I want to insert it into a database, but what ends up getting inserted is:
c:wwwtest
I can not get php to double the back slashes no matter what I do!
$string = str_replace("\\", "\\\\", $string);
That is what I want to do, get all single '\' into double '\\'...
Any suggestions?