I would like to know if there is any way to just remove backslashes '\' from a string with PHP? For some reason, when I use mysqli_real_escape_string() the output text has a '\' before any apostrophes. I know I could you use a function to strip the slashes but I want to keep all forward slashes '/'.
Btw, I've already made sure magic quotes is turned off. The problem still persists.
Thanks
There is a function for that and it is surprisingly called stripslashes
Here it goes: http://php.net/manual/en/function.stripslashes.php
QUERY:-remove backslashes '\' from a string but I want to keep all forward slashes '/'.
After hard working and googled if find result of your query:-
$path="uploads\\folder_name\\ankur/like you"; /////string
echo str_replace("\\"," ",$path);
output:-uploads folder_name ankur/like you