_mb_substr ( $str, $start, $length = null, $encoding = null )

  • (string) $str The string to extract the substring from.
  • (int) $start Position to being extraction from in `$str`.
  • (int|null) $length Optional. Maximum number of characters to extract from `$str`. Default null.
  • (string|null) $encoding Optional. Character encoding to use. Default null.
  • (string) Extracted substring.
Defined at:


Internal compat function to mimic mb_substr().

Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit. For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence. The behavior of this function for invalid inputs is undefined.

Related Functions

_mb_strlen, mb_strlen, randomcompat_substr, _wp_make_subsizes, _maybe_update_core

Top Google Results

User discussions

wpseek mobile