Characters with an accent are considered as two (I imagine the amount of bytes), how can I fix this?
$t = "á";
if(strlen($t) == 1){
echo "UM CARACTER";
}
if(strlen($t) == 2){
echo "DOIS CARACTER";
}
if(strlen($t) == 3){
echo "TRES CARACTER";
}
Another problem I'm facing is $string{0}
unable to identify accents.
$text = "á25";
echo $text{0}."<br>"; //retorna �
echo $text{1}."<br>"; //retorna �
echo $text{2}."<br>"; //retorna 2
echo $text{3}."<br>"; //retorna 5
And putting in ISO-8859-1 stands
$text = "á25";
echo $text{0}."<br>"; //retorna Ã
echo $text{1}."<br>"; //retorna ¡
echo $text{2}."<br>"; //retorna 2
echo $text{3}."<br>"; //retorna 5