<?php
$str = "àbcÂef"; // visualmente são 6 caracteres, mas internamente são 8 (2 UTF)
$i = 0; // pointer para a string
$c = 0; // contador de caracteres
while ($str[$i]<>"") {
if (ord($str[$i]) >= 127) // se for utf, despreza o caractere seguinte $i++;
$c++;
$i++;
}
echo $c;
PD9waHAKJHN0ciA9ICLDoGJjw4JlZiI7IC8vIHZpc3VhbG1lbnRlIHPDo28gNiBjYXJhY3RlcmVzLCBtYXMgaW50ZXJuYW1lbnRlIHPDo28gOCAoMiBVVEYpCiRpID0gMDsgLy8gcG9pbnRlciBwYXJhIGEgc3RyaW5nCiRjID0gMDsgLy8gY29udGFkb3IgZGUgY2FyYWN0ZXJlcwp3aGlsZSAoJHN0clskaV08PiIiKSB7CiAgICBpZiAob3JkKCRzdHJbJGldKSA+PSAxMjcpIC8vIHNlIGZvciB1dGYsIGRlc3ByZXphIG8gY2FyYWN0ZXJlIHNlZ3VpbnRlCiAgICAgICAgJGkrKzsKICAgICRjKys7CiAgICAkaSsrOwp9CmVjaG8gJGM7CiAgICA=