Use mb_strlen() to avoid "mb_strpos(): Empty delimiter" error with PHP 5.3.x.