Example 1 — Find the Last Match Ignoring Case
Search for the last "hello" in any capitalization.
<?php
$text = "Hello hello";
$pos = strripos($text, "HELLO");
echo $pos, PHP_EOL; How It Works
- The string contains "Hello" at 0 and "hello" at 6.
- Search for "HELLO" in uppercase.
- Case is ignored, so both match.
- strripos returns the position of the last one: 6.

