(PHP 5, PHP 7)
strripos — 锟斤拷锟斤拷指锟斤拷锟街凤拷锟斤拷锟斤拷目锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟揭伙拷纬锟斤拷值锟轿伙拷茫锟斤拷锟斤拷锟斤拷执锟叫⌒达拷锟�
$haystack
, string $needle
[, int $offset
= 0
] ) : int锟皆诧拷锟斤拷锟街达拷小写锟侥凤拷式锟斤拷锟斤拷指锟斤拷锟街凤拷锟斤拷锟斤拷目锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟揭伙拷纬锟斤拷值锟轿伙拷谩锟斤拷锟� strrpos() 锟斤拷同锟斤拷strripos() 锟斤拷锟斤拷锟街达拷小写锟斤拷
haystack
锟节达拷锟街凤拷锟斤拷锟叫斤拷锟叫诧拷锟揭★拷
needle
注锟斤拷 needle
锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷锟街凤拷锟斤拷锟竭讹拷锟街凤拷锟斤拷锟街凤拷锟斤拷锟斤拷
offset
锟斤拷锟斤拷 offset
锟斤拷锟皆憋拷指锟斤拷锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟解长锟饺碉拷锟斤拷锟街凤拷锟斤拷锟斤拷
锟斤拷锟斤拷偏锟斤拷锟斤拷锟斤拷使锟矫诧拷锟揭达拷锟街凤拷锟斤拷锟斤拷锟斤拷始位锟矫匡拷始锟斤拷锟斤拷 offset
位锟斤拷为止锟斤拷
锟斤拷锟斤拷 needle 锟斤拷锟斤拷锟� haystack
锟街凤拷锟斤拷锟斤拷位锟斤拷(锟斤拷锟斤拷锟斤拷锟侥凤拷锟斤拷锟狡拷锟斤拷锟斤拷薰锟�)锟斤拷同时注锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷始位锟斤拷为 0 锟斤拷锟斤拷 1锟斤拷
锟斤拷锟� needle 未锟斤拷锟斤拷锟街o拷锟斤拷锟斤拷 FALSE
锟斤拷
锟剿猴拷锟斤拷锟斤拷锟杰凤拷锟截诧拷锟斤拷值
FALSE
锟斤拷锟斤拷也锟斤拷锟杰凤拷锟截碉拷同锟斤拷 FALSE
锟侥非诧拷锟斤拷值锟斤拷锟斤拷锟侥讹拷 锟斤拷锟斤拷锟斤拷锟斤拷锟铰斤拷锟皆伙拷取锟斤拷锟斤拷锟斤拷息锟斤拷应使锟斤拷
===
锟斤拷锟斤拷锟�锟斤拷锟斤拷锟皆此猴拷锟斤拷锟侥凤拷锟斤拷值锟斤拷
Example #1 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)