Function __global->strpos

Definitions

sources_custom/phpstub.php

  • Find position of first occurrence 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
$haystack string No No required parameter N/A N/A Haystack
$needle string No No required parameter N/A N/A Needle
$offset integer No No 0 N/A N/A Offset to search from

Returns

  • The offset it is found at (false: not found)
  • Type: ~integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find position of first occurrence of a string.
 *
 * @param  string $haystack Haystack
 * @param  string $needle Needle
 * @param  integer $offset Offset to search from
 * @return ~integer The offset it is found at (false: not found)
 */

function strpos(string $haystack, string $needle, int $offset = 0)