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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -