PHP: Rearranging digits in an integer number -
i have numerous 15 digit numbers. need rearrange digits in each number based on set order hide composite identifiers. exaample: convert 123456789123456 223134897616545
the method thinking of :
1) extract each digit using $array = str_split($int) 2) create new array required order $array above
but here stuck. how combine digits of array single integer? efficient way this?
also need know order in shuffled retrieve original number.
implode array , cast int.
(int) impode('',$array)
Comments
Post a Comment