It seems like MySQL does not support characters with more than 3 bytes in its default UTF-8 charset.
So, in PHP, how can I get rid of all 4(-and-more)-byte character
Below function change 3 and 4 bytes characters from utf8 string to '#':
function remove3and4bytesCharFromUtf8Str($str) { return preg_replace('/([\xF0-\xF7]...)|([\xE0-\xEF]..)/s', '#', $str); }