I’ve got the following problem.
When a form is submitted using ajax I need to check a few of the POST-variables if they contain the special characters æ, ø and å (as well as uppercase Æ Ø Å). Say I have 100 POST-variables, I really only care about a few of them (say firstname, lastname and adress). If it contains these letters the content of the variable should be utf8_encoded.
How can this be done in a nice dynamic way? I need to be able to change what variables I am checking easily (I guess the best way is to store this in an array).
Are there any neat ways to do this, or do I have to have a mess of loops in order to accomplish this?
This might help:
Ref: mb_detect_encoding