src/Drupal/Component/Utility/Unicode.php
public static function strpos($haystack, $needle, $offset = 0) {
    if (static::getStatus() == static::STATUS_MULTIBYTE) {
      return mb_strpos($haystack, $needle, $offset);
    }
    else {
      // Remove Unicode continuation characters, to be compatible with
      // Unicode::strlen() and Unicode::substr().
      $haystack = preg_replace("/[\x80-\xBF]/", '', $haystack);
      $needle = preg_replace("/[\x80-\xBF]/", '', $needle);
      return strpos($haystack, $needle, $offset);
    }
  }
public static function strpos($haystack, $needle, $offset = 0) {
    if (static::getStatus() == static::STATUS_MULTIBYTE) {
      return mb_strpos($haystack, $needle, $offset);
    }
    else {
      // Remove Unicode continuation characters, to be compatible with
      // Unicode::strlen() and Unicode::substr().
      $haystack = preg_replace("/[\x80-\xBF]/", '', $haystack);
      $needle = preg_replace("/[\x80-\xBF]/", '', $needle);
      return strpos($haystack, $needle, $offset);
    }
  }
public static function strpos ( $ haystack , $ needle , $ offset = 0 ) { if ( static :: getStatus ( ) == static :: STATUS_MULTIBYTE ) { return mb_strpos ( $ haystack , $ needle , $ offset ) ; } else { // Remove Unicode continuation characters, to be compatible with // Unicode::strlen() and Unicode::substr(). $ haystack = preg_replace ( "/[\x80-\xBF]/" , '' , $ haystack ) ; $ needle = preg_replace ( "/[\x80-\xBF]/" , '' , $ needle ) ; return strpos ( $ haystack , $ needle , $ offset ) ; } }
Finds the position of the first occurrence of a string in another string.

@param string $haystack
The string to search in.
@param string $needle
The string to find in $haystack.
@param int $offset
If specified, start the search at this number of characters from the
beginning (default 0).

@return int|false
The position where $needle occurs in $haystack, always relative to the
beginning (independent of $offset), or FALSE if not found. Note that
a return value of 0 is not the same as FALSE.
Finds the position of the first occurrence of a string in another string .