php - preg_replace ranged out - compilation failed -


in code:

 $c = preg_replace('#[^a-z0-9áčďéěíňóřšťúůýž_-:().,;!?]#i', '', $_post['c']); 


i error:
warning: preg_replace() [function.preg-replace]: compilation failed: range out of order in character class @ offset 40


idk error.

do way:

$c = preg_replace('#[^a-z0-9áčďéěíňóřšťúůýž_\-:().,;!?]#i', '', $_post['c']); 

you need escape - inside square brackets [..] because it's treated interval specifier


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -