I have numerous 15-digit numbers. I need to rearrange the digits in each string based on a set order to hide the composite identifiers. For example: convert 123456789123456 to 223134897616545
The method I am thinking of is:
- Extract each digit using
$array = str_split($int)
- Create a new array with required order from
$array
above
But here is where I am stuck. How do I combine all digits of array to single integer? Also is this an efficient way to do this?
Also I need to know the order in which it was shuffled so as to retrieve the original number.