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

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -