I've been trying and searching for a working solution, but nothing seemed to work..
I'm making a social website, where the users can post. I would like to check the text before it goes into the database.
I would like to make the regular characters enabled (a-zA-Z0-9) + some utf8 characters (áÁéÉíÍóÓöÖőŐúÚüÜűŰ) and some other characters (.,?!;. etc.)
I've been trying, but it doesn't seem to work:
preg_replace('/[^a-zA-Z0-9áÁéÉíÍóÓöÖőŐúÚüÜűŰ \.\,\?\!\:\;\-\+\<\>\%\~\€\$\[\]\{\}\@\&\#\*\"\„\”\/]/', '', $string);
Could someone help me out?
Is there anything easier? The reason why I'm doing this is because I don't wanna allow the users to spam the database with illegal characters, or HTML tags.. It would be so bad if someone wrote a post like this "blabla</div>".