CKTIS / PHP
strripos()
Find the final match position ignoring ASCII case.
Version: PHP 8.4; repository runtime, production runtime not attested
Syntax
strripos(string $haystack, string $needle, int $offset = 0): int|falseFind the final match position ignoring ASCII case. A positive offset excludes earlier starting positions. A negative offset sets the last starting position considered, counted back from the end. The index is in bytes and zero must be distinguished from false.
Signature
strripos(string $haystack, string $needle, int $offset = 0): int|false
Example output
[6,6,3,false]
Examples
<?php
$s="AbxABxab"; echo json_encode([strripos($s,"aB"),strripos($s,"aB",4),strripos($s,"aB",-4),strripos($s,"zz")]);
Result
[6,6,3,false]