function drupal_substr

Cuts off a piece of a string based on character indices and counts.

Parameters

$text: The input string.

$start: The position at which to start reading.

$length: The number of characters to read.

Return value

The shortened string.

See also

\Drupal\Component\Utility\Unicode::substr().

Related topics

21 calls to drupal_substr()

File

drupal/core/includes/unicode.inc, line 324
Provides Unicode-related conversions and operations.

Code

function drupal_substr($text, $start, $length = NULL) {
  return Unicode::substr($text, $start, $length);
}