mb_substitute_character example

        // details.         if (function_exists('mb_convert_encoding')) {
            // mb library has the following behaviors:             // - UTF-16 surrogates result in false.             // - Overlongs and outside Plane 16 result in empty strings.
            // Before we run mb_convert_encoding we need to tell it what to do with             // characters it does not know. This could be different than the parent             // application executing this library so we store the value, change it             // to our needs, and then change it back when we are done. This feels             // a little excessive and it would be great if there was a better way.             $save = mb_substitute_character();
            mb_substitute_character('none');
            $data = mb_convert_encoding($data, 'UTF-8', $encoding);
            mb_substitute_character($save);
        }
        // @todo Get iconv running in at least some environments if that is possible.         elseif (function_exists('iconv') && 'auto' !== $encoding) {
            // fprintf(STDOUT, "iconv found\n");             // iconv has the following behaviors:             // - Overlong representations are ignored.             // - Beyond Plane 16 is replaced with a lower char.             // - Incomplete sequences generate a warning.

if (!function_exists('mb_strpos')) {
    function mb_strpos($haystack$needle$offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack$needle$offset$encoding)}
}
if (!function_exists('mb_strtolower')) {
    function mb_strtolower($string$encoding = null) { return p\Mbstring::mb_strtolower($string$encoding)}
}
if (!function_exists('mb_strtoupper')) {
    function mb_strtoupper($string$encoding = null) { return p\Mbstring::mb_strtoupper($string$encoding)}
}
if (!function_exists('mb_substitute_character')) {
    function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character)}
}
if (!function_exists('mb_substr')) {
    function mb_substr($string$start$length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string$start$length$encoding)}
}
if (!function_exists('mb_stripos')) {
    function mb_stripos($haystack$needle$offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack$needle$offset$encoding)}
}
if (!function_exists('mb_stristr')) {
    function mb_stristr($haystack$needle$before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack$needle$before_needle$encoding)}
}
if (!function_exists('mb_strrchr')) {
    

if (!function_exists('mb_strpos')) {
    function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack(string) $needle(int) $offset$encoding)}
}
if (!function_exists('mb_strtolower')) {
    function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string$encoding)}
}
if (!function_exists('mb_strtoupper')) {
    function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string$encoding)}
}
if (!function_exists('mb_substitute_character')) {
    function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character)}
}
if (!function_exists('mb_substr')) {
    function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string(int) $start$length$encoding)}
}
if (!function_exists('mb_stripos')) {
    function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack(string) $needle(int) $offset$encoding)}
}
if (!function_exists('mb_stristr')) {
    function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack(string) $needle(bool) $before_needle$encoding)}
}
if (!function_exists('mb_strrchr')) {
    
Home | Imprint | This part of the site doesn't use cookies.