1. Go to this page and download the library: Download submtd/cashaddr-converter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// convert from a legacy address to a cashaddr address
$legacyAddress = '1PchCm7XXAjifhpchPB8wR2WG5rzMFqjnR';
CashaddrConverter::convertToCashaddr($legacyAddress);
// returns bitcoincash:qrup9c40gr9usrz6m7rg7rknjmsp685r2yhxkdx8tf
// convert from a cashaddr address to a legacy address
$cashaddrAddress = 'bitcoincash:qrup9c40gr9usrz6m7rg7rknjmsp685r2yhxkdx8tf';
CashaddrConverter::convertFromCashaddr($cashaddrAddress);
// returns 1PchCm7XXAjifhpchPB8wR2WG5rzMFqjnR
// convert from a legacy address to a cashaddr address
$legacyAddress = '1PchCm7XXAjifhpchPB8wR2WG5rzMFqjnR';
convertToCashaddr($legacyAddress);
// returns bitcoincash:qrup9c40gr9usrz6m7rg7rknjmsp685r2yhxkdx8tf
// convert from a cashaddr address to a legacy address
$cashaddrAddress = 'bitcoincash:qrup9c40gr9usrz6m7rg7rknjmsp685r2yhxkdx8tf';
convertFromCashaddr($cashaddrAddress);
// returns 1PchCm7XXAjifhpchPB8wR2WG5rzMFqjnR
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.