I have a website where people can add content and when they type in titles, all characters are filtered when parsing to MySQL with PHP, only allowing members to write text and numbers. But I want to allow dashes (-) and brackets/parenthesis (()). Currently, I have:
$video_title = preg_replace('#[^A-za-z0-9 ?!.,]#i', '', $_POST['video_title']);
What shall I add or remove to the preg_replace function to allow these characters?
Just add the
\( \) \-to the expressionSince it just got erased, you only the the
a-zonce if it is case insensitive.