text: divide the whole string by 2. i is used to track index in current number . j is used to track index for next iteration .
code: $ j = 0 ; for ( $ i = 0 ; $ i < $ len_str ; $ i ++ ) { $ num = $ num * 10 + ( ord ( $ str [ $ i ] ) - ord ( '0' ) ) ;