1
Accented characters are considered as two (I imagine the number 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 is
$text = "á25";
echo $text{0}."<br>"; //retorna Ã
echo $text{1}."<br>"; //retorna ¡
echo $text{2}."<br>"; //retorna 2
echo $text{3}."<br>"; //retorna 5
Related: https://answall.com/questions/84100/strtoupper-acentos/84104
– novic
Lucas this issue would not be a new problem, different from the one reported earlier?
– user28595
More or less, the problem still has to do with accented characters, if you think better I open a new question :D
– Lucas Caresia