mb_strripos
ケース文字列内の文字列の最後の場所を無感覚に見つけます
関数名:mb_strripos()
該当するバージョン:PHP 4> = 4.2.0、PHP 5、PHP 7
関数の説明:MB_STRRIPOS()関数は、指定された文字列の最後の発生を別の文字列(ケースの鈍感)に戻します。文字列が見つからない場合、falseが返されます。
構文:mb_strripos(string $ haystack、string $ edele、int $ offset = 0、string $ encoding = null):int | bool
パラメーター:
返品値:
例1:
$string = "Hello, World!"; $needle = "world"; $position = mb_strripos($string, $needle); if ($position !== false) { echo "找到了needle 在haystack 中的位置:$position"; } else { echo "未找到needle 在haystack 中"; }
出力:
找到了needle 在haystack 中的位置:7
例2:
$string = "Hello, World!"; $needle = "WORLD"; $position = mb_strripos($string, $needle); if ($position !== false) { echo "找到了needle 在haystack 中的位置:$position"; } else { echo "未找到needle 在haystack 中"; }
出力:
找到了needle 在haystack 中的位置:7
注: