PHP code example of cryptothree / crypto-address-validator

1. Go to this page and download the library: Download cryptothree/crypto-address-validator 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/ */

    

cryptothree / crypto-address-validator example snippets


use Cryptothree\CryptoAddressValidator\Enums\CurrencyEnum;
use Cryptothree\CryptoAddressValidator\CryptoAddressValidator;

// create a validator instance
$validator = CryptoAddressValidator::make(CurrencyEnum::BTC);
// can also pass a chain symbol string to the constructor
$validator = CryptoAddressValidator::make('BTC');

$result = $validator->isValid('1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2');
// or testnet
$result = $validator->testnet()->isValid('tb1q27dglj7x4l34mj7j2x7e6fqsexk6vf8kew6qm0');