Example 1 — Find the Last Letter
Find the last l in a text with accents.
<?php
$text = "Héllo Wörld, hello";
echo iconv_strrpos($text, "l", "UTF-8"), PHP_EOL; How It Works
- The text has several
lletters. - The search starts at the end.
- The last
lis the 17th character, so its position is 16. - Positions start at 0 and count letters, not bytes.

