close
[php]strripos — 計算指定字符串在目標字符串中最後一次出現的位置(不區分大小寫)
官方範例
<?php
$haystack = 'ababcd';
$needle = 'aB';
$pos = strripos($haystack, $needle);
if ($pos === false) {
echo "Sorry, we did not find ($needle) in ($haystack)";
} else {
echo "Congratulations!\n";
echo "We found the last ($needle) in ($haystack) at position ($pos)";
}
?>
以上例程會輸出:
Congratulations!
We found the last (aB) in (ababcd) at position (2)
全站熱搜