function Iconv::iconv_strrpos
File
-
vendor/
symfony/ polyfill-iconv/ Iconv.php, line 504
Class
- Iconv
- iconv implementation in pure PHP, UTF-8 centric.
Namespace
Symfony\Polyfill\IconvCode
public static function iconv_strrpos($haystack, $needle, $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;
}
}
$pos = isset($needle[0]) ? strrpos($haystack, $needle) : false;
return false === $pos ? false : self::iconv_strlen($pos ? substr($haystack, 0, $pos) : $haystack, 'utf-8');
}