You can access characters from a string as if it were an array.
Note: As warned in the comments, accented characters (UTF-8) occupy two spaces instead of one, so to detect this type of character, we see if its code (ord) has value> = 127.
p>
See this table: link
In this way, the code below does this type of conference, without using PHP functions as you requested.
<?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;
Show: 6
(See working code at link )