Example 1 — Take the First Letters
Cut the first five characters of a text with accents.
<?php
$text = "Héllo Wörld";
echo iconv_substr($text, 0, 5, "UTF-8"), PHP_EOL; How It Works
- Start at position 0.
- Take 5 characters. The
écounts as one. - No letter is cut in half.
- Print the part. You see
Héllo.

