I have to do arithmetic with some ternary (base 3) numbers. I know I can use base_convert to get from a ternary string ("2001022210") to an integer. Is there an existing function to do the inverse?
I want "some_function" such that:
$someInteger = base_convert("2001022210", 10, 3);
some_function($someInteger);
answers "2001022210". I'm happy to provide extra arguments ...
some_function($someInteger, 3);
some_function($someInteger, 3, 10);
I know I can code this myself, but I'm hoping it's already there.