The start position begins at 0
not 1
. So to get 5
you use 1,1
and to get 0
use 2,1
.
0,1
will give you the first character 9
.
Also, the third parameter to substr()
is the length, so if you use 1
you get 1 character from the start
or 2
gives you 2 characters from the start.
0,6
will give 950122
.