PHP code example of headzoo / bitcoin-tools
1. Go to this page and download the library: Download headzoo/bitcoin-tools 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/ */
headzoo / bitcoin-tools example snippets
$testnet = false;
$validator = new Headzoo\Bitcoin\Tools\Validator($testnet);
if ($validator->isValid("1Headz2mYtpBRo6KFaaUEtcm5Kce6BZRJM")) {
echo "This livenet address is valid.";
} else {
echo "This livenet address is not valid.";
}
$testnet = true;
$validator = new Headzoo\Bitcoin\Tools\Validator($testnet);
if ($validator->isValid("mibNyNV8UNGrW7ySMS4htmvAGkhC1vVmAe")) {
echo "This testnet address is valid.";
} else {
echo "This testnet address is not valid.";
}