I have a strange bug in my site:
I have a get variable in url ?getClass=9а
For some reason when I output it's strlen it is on 1 symbol more than it actually is.
For example:
9a strlen - 3
10a strlen - 4
11a strlen - 4
The other strange thing is that when I try to substring using it's strlen:
$classNumber=substr($_GET['getClass'],0,strlen($_GET['getClass']-1));
$classLetter=substr($_GET['getClass'], strlen($_GET['getClass']-1));
The result is like this:
9a $classNumber=9 $classLetter=а that's ok
10а $classNumer=1 $classLetter=0a that's wrong
11a $classNumber=11 $classLetter=a that's ok again.
What's wrong with it?