The UTF8 class provides support for UTF-8 environments. It includes a set of functions you may use to work with strings and text. These functions use the same syntax as those in PHP manual and include the following:

  • strlen
  • strpos
  • stripos
  • strrpos
  • substr
  • strtolower
  • strtoupper
  • str_replace

Example usage:

$str = utf8::strlen($str);