PHP inverse function for base_convert? <p>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?</p> <p>I want "some_function" such that:</p> <pre><code>$someInteger = base_convert("2001022210", 10, 3); some_function($someInteger); </code></pre> <p>answers "2001022210". I'm happy to provide extra arguments ...</p> <pre><code>some_function($someInteger, 3); some_function($someInteger, 3, 10); </code></pre> <p>I know I can code this myself, but I'm hoping it's already there.</p>