I have the following url:
$str = \"http://www.domain.com/data/images\\flags/en.gif\";
I\'m using str_replace
to try and replac
You need to escape backslash with a \
$str = str_replace ("\\", "/", $str);
You want to replace the Backslash?
Try stripcslashes:
http://www.php.net/manual/en/function.stripcslashes.php
No regex, so no need for //.
this should work:
$str = str_replace("\\", '/', $str);
You need to escape "\" as well.
Single quoted php string variable works.
$str = 'http://www.domain.com/data/images\flags/en.gif';
$str = str_replace('\\', '/', $str);
you have to place double-backslash
$str = str_replace('\\', '/', $str);
$str = str_replace('\\', '/', $str);