Yes, you can do it with regex, and in some specific cases you might need that, but PHP comes with a built-in function to handle escaping query strings, and it works fine for every situation I've needed. See
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.