(PHP 5, PHP 7, PHP 8)
iconv_strrpos — 在 haystack 中查找 needle 的最后一次出现位置
在 haystack 中查找 needle 的最后一次出现位置。
与 strrpos() 不同,iconv_strrpos() 的返回值是在 needle 之前出现的字符数,而不是找到 needle 位置的字节偏移量。字符计数基于指定的字符集 encoding。
haystack整个字符串。
needle要搜索的子字符串。
encoding如果省略 encoding 参数或为 null,则假定 string 使用 iconv.internal_encoding 编码。
如果 haystack 或 needle 不是字符串,则将其转换为字符串并应用为字符的序数值。
| 版本 | 描述 |
|---|---|
| 8.0.0 |
encoding 现在可以为空。 |