Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Mbstring.php

function Mbstring::mb_strpos

1 call to Mbstring::mb_strpos()
Mbstring::mb_stripos in vendor/symfony/polyfill-mbstring/Mbstring.php

File

vendor/symfony/polyfill-mbstring/Mbstring.php, line 525

Class

Mbstring
Partial mbstring implementation in PHP, iconv based, UTF-8 centric.

Namespace

Symfony\Polyfill\Mbstring

Code

public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) {
    $encoding = self::getEncoding($encoding);
    if ('CP850' === $encoding || 'ASCII' === $encoding) {
        return strpos($haystack, $needle, $offset);
    }
    $needle = (string) $needle;
    if ('' === $needle) {
        if (80000 > \PHP_VERSION_ID) {
            trigger_error(__METHOD__ . ': Empty delimiter', \E_USER_WARNING);
            return false;
        }
        return 0;
    }
    return iconv_strpos($haystack, $needle, $offset, $encoding);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal