Function __global->substr

Definitions

sources_custom/phpstub.php

  • Return part of a string.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$string string No No required parameter N/A N/A The subject
$start integer No No required parameter N/A N/A The start position
$length ?integer No No Null N/A N/A The length to extract (null: all remaining)

Returns

  • String part (false: $start was over the end of the string)
  • Type: ~string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Return part of a string.
 *
 * @param  string $string The subject
 * @param  integer $start The start position
 * @param  ?integer $length The length to extract (null: all remaining)
 * @return ~string String part (false: $start was over the end of the string)
 */

function substr(string $string, int $start, ?int $length = null)