Iterative function to reverse digits of num
< ? php function reversDigits ( $ num ) { $ rev_num = 0 ; while ( $ num > 0 ) { $ rev_num = $ rev_num * 10 + $ num % 10 ; $ num = ( int ) ( $ num / 10 ) ; } return $ rev_num ; }