I\'m having some issues using the following code on user input:
htmlentities($string, ENT_COMPAT, \'UTF-8\');
When an invalid multibyte cha
iconv('UTF-8', "ISO-8859-1//IGNORE", $string);
worked extremely well for me. Doesn't seem to generate any notice.