function Iconv::iconv_strpos
File
-
vendor/
symfony/ polyfill-iconv/ Iconv.php, line 481
Class
- Iconv
- iconv implementation in pure PHP, UTF-8 centric.
Namespace
Symfony\Polyfill\IconvCode
public static function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) {
if (null === $encoding) {
$encoding = self::$internalEncoding;
}
if (0 !== stripos($encoding, 'utf-8')) {
if (false === ($haystack = self::iconv($encoding, 'utf-8', $haystack))) {
return false;
}
if (false === ($needle = self::iconv($encoding, 'utf-8', $needle))) {
return false;
}
}
if ($offset = (int) $offset) {
$haystack = self::iconv_substr($haystack, $offset, 2147483647, 'utf-8');
}
$pos = strpos($haystack, $needle);
return false === $pos ? false : $offset + ($pos ? self::iconv_strlen(substr($haystack, 0, $pos), 'utf-8') : 0);
}