Or if you didn't want to waste time creating a string (I mean execution time), you could just use the mod operator ( % ) to get the remainder after dividing by 10, that would give you the units. To get tens, divide by 10 then mod 10. To get 100s, divide by 100 then mode 10. You could use a function like this:
PHP Code:
int getDigit(int iPositionint iNumberint iRadix)
{
     for(
int i=0i<iPositioni++)
          
iNumber /= iRadix;
     
     return(
iNumber iRadix);

posotion 0 is the units, 1 is tens, 2 is hundreds, etc.