PHP code example of thetaxrate / ttr-php-composer

1. Go to this page and download the library: Download thetaxrate/ttr-php-composer 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/ */

    

thetaxrate / ttr-php-composer example snippets




namespace {
    use TheTaxRate\SalesTaxService;

    function main() {
        $service = new SalesTaxService('API_TOKEN');
        $response = $service->getTaxRate('90210');
        $saleTaxRate = $response->getRate();
    }
}
 bash
$ composer