I would like to remove all back slashes from strings on my site. I do not wish to use strip_slashes(), because I want to keep forward slashes.
This is the code I am
No sure why you are using str_replace to remove \ use
echo stripslashes("it\'s Tuesday!");
But if its just an example then
echo str_replace("\\","","it\'s Tuesday!");
Please Note that stripslashes only remove backslashes not forward
echo stripslashes("it\'s \\ \\ // Tuesday!");
Outputs
it's // Tuesday!