(PHP 5, PHP 7, PHP 8)
iconv_strrpos — 尋找 haystack 中最後一次出現 needle 的位置
在 haystack
中尋找最後一次出現 needle
的位置。
與 strrpos() 不同的是,iconv_strrpos() 的返回值是 needle 之前出現的字元數量,而不是以位元組為單位的偏移量。字元計算是基於指定的字元集 encoding
。
haystack
整個字串。
needle
要搜尋的子字串。
encoding
如果省略 encoding
參數或設為 null
,則假設 string
使用 iconv.internal_encoding 編碼。
如果 haystack
或 needle
不是字串,則會將其轉換為字串,並作為字元的序數值使用。
版本 | 說明 |
---|---|
8.0.0 |
encoding 現在可以為 null。 |