I want to replace all forward slashes /
in my URL with \/
.
For example, this URL
http://media3.giphy.com/media/8etoa2PC4Mgx2/200w.mp4
should be changed to
http:\/\/media3.giphy.com\/media\/8etoa2PC4Mgx2\/200w.mp4
I have tried to do this with this code:
<?php
$filename="http://media3.giphy.com/media/8etoa2PC4Mgx2/200w.mp4"
$filename=str_replace("\//","\/","$filename");
echo $filename:
?>
but it is not working. How can I do this?