How to remove from get and post links signs ------
double quotes - " ",
asterisk *, sign | and other characters? For example:

http://mysite.ru/htm"""l.html http://mysite.ru/htm****l http://mysite.ru/htm||||l 

Or if there is such a sign, then send to page 404.
str_replace, strtr does not help, and, if possible, the code and verified answer.

2 answers 2

 if(preg_match('/\"|\*|\|/', $str)) { echo 404; } else { echo 200; } 

And just do it wrong, because you need to check for valid characters in the url, and not to prohibit everything in such a way, as a result, the regularization xD can swell

  • I need that these 3 characters were not, with others figured out. And you can code how to check for valid characters in the url, in urla there should be only Latin letters, numbers and -. Maybe someone knows how to be regular? Already much time I suffer, kind people, help, pliz. - vasak
  • @vasak, [this option] [1] is suitable? [1]: ideone.com/2lnMGu - Deonis

In normal CMS, they grab the URL, throw it into the working array and then work with it as they want, and ofc you can change it as you like, so you should not have any problems with the implementation of this idea.