WesleyA Posted December 15, 2015 Share Posted December 15, 2015 Hi there I'm looking for a way to strip multiple backslashes. I'm able to strip up to 7 backslashes. This is my code: $url = stripslashes($url); $url = stripslashes($url); $url = stripslashes($url); You read it well, I used it 3 times. I know the backslash is a delimiter so it is necessary to use it 3 times to strip one slash. But my goal is (like with other characters) to strip all. How is PHP handling this? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 15, 2015 Share Posted December 15, 2015 I'm not sure what the point is, but you can run that in a while loop until the text doesn't change. Link to comment Share on other sites More sharing options...
john_jack Posted December 16, 2015 Share Posted December 16, 2015 if wha you want is clean string no \ then use this : $url="\sd\s\qq\\\\\\"; echo $url."<br>"; do{ $cleanurl=$url; $url=stripslashes($url); }while($cleanurl!=$url); echo $url."<br>"; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now