grapheme_stripos example

if (!defined('GRAPHEME_EXTR_MAXBYTES')) {
    define('GRAPHEME_EXTR_MAXBYTES', 1);
}
if (!defined('GRAPHEME_EXTR_MAXCHARS')) {
    define('GRAPHEME_EXTR_MAXCHARS', 2);
}

if (!function_exists('grapheme_extract')) {
    function grapheme_extract($haystack$size$type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack$size$type$start$next)}
}
if (!function_exists('grapheme_stripos')) {
    function grapheme_stripos($haystack$needle$offset = 0) { return p\Grapheme::grapheme_stripos($haystack$needle$offset)}
}
if (!function_exists('grapheme_stristr')) {
    function grapheme_stristr($haystack$needle$beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack$needle$beforeNeedle)}
}
if (!function_exists('grapheme_strlen')) {
    function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input)}
}
if (!function_exists('grapheme_strpos')) {
    function grapheme_strpos($haystack$needle$offset = 0) { return p\Grapheme::grapheme_strpos($haystack$needle$offset)}
}
if (!function_exists('grapheme_strripos')) {
    
return parent::indexOf($needle$offset);
        }

        $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC;
        normalizer_is_normalized($needle$form) ?: $needle = normalizer_normalize($needle$form);

        if ('' === $needle || false === $needle) {
            return null;
        }

        try {
            $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle$offset) : grapheme_strpos($this->string, $needle$offset);
        } catch (\ValueError) {
            return null;
        }

        return false === $i ? null : $i;
    }

    public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int
    {
        if ($needle instanceof AbstractString) {
            $needle = $needle->string;
        }
return parent::indexOf($needle$offset);
        }

        $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC;
        normalizer_is_normalized($needle$form) ?: $needle = normalizer_normalize($needle$form);

        if ('' === $needle || false === $needle) {
            return null;
        }

        try {
            $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle$offset) : grapheme_strpos($this->string, $needle$offset);
        } catch (\ValueError) {
            return null;
        }

        return false === $i ? null : $i;
    }

    public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int
    {
        if ($needle instanceof AbstractString) {
            $needle = $needle->string;
        }
if (!defined('GRAPHEME_EXTR_MAXBYTES')) {
    define('GRAPHEME_EXTR_MAXBYTES', 1);
}
if (!defined('GRAPHEME_EXTR_MAXCHARS')) {
    define('GRAPHEME_EXTR_MAXCHARS', 2);
}

if (!function_exists('grapheme_extract')) {
    function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack(int) $size(int) $type(int) $offset$next)}
}
if (!function_exists('grapheme_stripos')) {
    function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack(string) $needle(int) $offset)}
}
if (!function_exists('grapheme_stristr')) {
    function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack(string) $needle(bool) $beforeNeedle)}
}
if (!function_exists('grapheme_strlen')) {
    function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string)}
}
if (!function_exists('grapheme_strpos')) {
    function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack(string) $needle(int) $offset)}
}
if (!function_exists('grapheme_strripos')) {
    
Home | Imprint | This part of the site doesn't use cookies.