That's nice -- how?
We made a filter of acceptable characters, but we they dropped the assignment to use a trigger for it. The only little problem was that it sometimes filtered HTTP-links, but our teacher didn't mind that
This is the script:
<?php
function test_language($text){
$allowed = str_split("abcdefghijklmnopqrstuvwxyzàáäéèëÈÉÊËÌÍÎÏÁÙÚ^1234567890,./;’‘[]\-=~!@#$%^&*()_+{}|`:\"?><€ ");
$count = 0;
for($i=0;$i<=strlen($text);$i++){
for($j=0;$j<=count($allowed);$j++){
if(substr($text,$i,1)==$allowed[$j]){
$count++;
break;
}
}
}
if(strlen($text) == $count){
return true;
} else { return false; }
}
?>