convert our temporary string into integer
$ temp = 0 ; for ( $ j = 0 ; $ j < strlen ( $ str ) ; $ j ++ ) $ temp = $ temp * 10 + ( ord ( $ str [ $ j ] ) - ord ( '0' ) ) ; $ k = ( int ) ( sqrt ( $ temp ) ) ;