CodeExplorer strlen2 example
public static function iconv_strlen($s,
$encoding = null
) { static $hasXml = null;
if (null ===
$hasXml) { $hasXml = \
extension_loaded('xml'
);
} if ($hasXml) { return self::
strlen1($s,
$encoding);
} return self::
strlen2($s,
$encoding);
} public static function strlen1($s,
$encoding = null
) { if (null ===
$encoding) { $encoding = self::
$internalEncoding;
} if (0 !==
stripos($encoding, 'utf-8'
) && false ===
$s = self::
iconv($encoding, 'utf-8',
$s)) { return false;
} if (!
function_exists('iconv_substr'
)) { function iconv_substr(?string
$string, ?int
$offset, ?int
$length = null, ?string
$encoding = null
): string|false
{ null ===
$encoding &&
$encoding = p\Iconv::
$internalEncoding;
return mb_substr((string) $string,
(int) $offset,
$length,
$encoding);
} } if (!
function_exists('iconv_mime_decode'
)) { function iconv_mime_decode($string,
$mode = 0,
$encoding = null
) { $currentMbEncoding =
mb_internal_encoding(); null ===
$encoding &&
$encoding = p\Iconv::
$internalEncoding;
mb_internal_encoding($encoding);
$decoded =
mb_decode_mimeheader($string);
mb_internal_encoding($currentMbEncoding);
return $decoded;
} }} else { if (!
function_exists('iconv_strlen'
)) { if (extension_loaded('xml'
)) { function iconv_strlen(?string
$string, ?string
$encoding = null
): int|false
{ return p\Iconv::
strlen1((string) $string,
$encoding);
} } else { function iconv_strlen(?string
$string, ?string
$encoding = null
): int|false
{ return p\Iconv::
strlen2((string) $string,
$encoding);
} } } if (!
function_exists('iconv_strpos'
)) { function iconv_strpos(?string
$haystack, ?string
$needle, ?int
$offset = 0, ?string
$encoding = null
): int|false
{ return p\Iconv::
iconv_strpos((string) $haystack,
(string) $needle,
(int) $offset,
$encoding);
} } if (!
function_exists('iconv_strrpos'
)) { function iconv_strrpos(?string
$haystack, ?string
$needle, ?string
$encoding = null
): int|false
{ return p\Iconv::
iconv_strrpos((string) $haystack,
(string) $needle,
$encoding);
} } if (!
function_exists('iconv_substr'
)) { function iconv_substr(?string
$string, ?int
$offset, ?int
$length = null, ?string
$encoding = null
): string|false
{ return p\Iconv::
iconv_substr((string) $string,
(string) $offset,
$length,
$encoding);
} } if (!
function_exists('iconv_substr'
)) { function iconv_substr($string,
$offset,
$length = 2147483647,
$encoding = null
) { null ===
$encoding &&
$encoding = p\Iconv::
$internalEncoding;
return mb_substr($string,
$offset,
$length,
$encoding);
} } if (!
function_exists('iconv_mime_decode'
)) { function iconv_mime_decode($string,
$mode = 0,
$encoding = null
) { $currentMbEncoding =
mb_internal_encoding(); null ===
$encoding &&
$encoding = p\Iconv::
$internalEncoding;
mb_internal_encoding($encoding);
$decoded =
mb_decode_mimeheader($string);
mb_internal_encoding($currentMbEncoding);
return $decoded;
} }} else { if (!
function_exists('iconv_strlen'
)) { if (extension_loaded('xml'
)) { function iconv_strlen($string,
$encoding = null
) { return p\Iconv::
strlen1($string,
$encoding);
} } else { function iconv_strlen($string,
$encoding = null
) { return p\Iconv::
strlen2($string,
$encoding);
} } } if (!
function_exists('iconv_strpos'
)) { function iconv_strpos($haystack,
$needle,
$offset = 0,
$encoding = null
) { return p\Iconv::
iconv_strpos($haystack,
$needle,
$offset,
$encoding);
} } if (!
function_exists('iconv_strrpos'
)) { function iconv_strrpos($haystack,
$needle,
$encoding = null
) { return p\Iconv::
iconv_strrpos($haystack,
$needle,
$encoding);
} } if (!
function_exists('iconv_substr'
)) { function iconv_substr($string,
$offset,
$length = 2147483647,
$encoding = null
) { return p\Iconv::
iconv_substr($string,
$offset,
$length,
$encoding);
} }