Based on the official TRON documentation, they have API based on TRONWEB to work with Javascript. https://developers.tron.network/reference#address
However I'm working on a backend PHP app and would like to store TRON address as Base58 instead of hex FORMAT (Default is HEX in API outputs) So is there any way to convert the address from HEX to Base58 in PHP?
(Have researched and couldn't find any possible answer already)
Yes, It's possible to do the conversion in php.
First, install the package
iexbase/tron-apivia composer.How I do mine is, I have a class called
Addressand it looks like:This
Addressclass extends aBaseclass which helps with setting up an instance of the Tron API client. TheBaseclass looks like:So you can then do
then access the address in whatever format:
or
I really hope this helps you.