How To Remove Backslashes From URL In PHP
1 min readOct 1, 2019
Problem:-
Sometime URL has unnecessary backslashes which gives error.
Solution:-
For removing backslashes stripslashes() string function is used in PHP.It removes backslashes in a string.
Syntax:-
stripslashes(string);
Example:-
URL:-
https:\/\/kaustubh\/remove\/shashes.php
Required Output:-
https://kaustubh/remove/shashes.php
Code:-
<?php
$a=”https:\/\/kaustubh\/remove\/shashes.php”;
echo stripslashes($a);
?>
Output:-
https://kaustubh/remove/shashes.php