You are here

public function Intl::substr in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-stdlib/src/StringWrapper/Intl.php \Zend\Stdlib\StringWrapper\Intl::substr()

Returns the portion of string specified by the start and length parameters

Parameters

string $str:

int $offset:

int|null $length:

Return value

string|false

Overrides StringWrapperInterface::substr

File

vendor/zendframework/zend-stdlib/src/StringWrapper/Intl.php, line 66

Class

Intl

Namespace

Zend\Stdlib\StringWrapper

Code

public function substr($str, $offset = 0, $length = null) {

  // Due fix of PHP #62759 The third argument returns an empty string if is 0 or null.
  if ($length !== null) {
    return grapheme_substr($str, $offset, $length);
  }
  return grapheme_substr($str, $offset);
}