(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 δ�����֣����� 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)