PHP code example of lyonstahl / fips

1. Go to this page and download the library: Download lyonstahl/fips 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/ */

    

lyonstahl / fips example snippets


$state = State::fromName('California');
echo $state->fips; // 06
echo $state->abbreviation; // CA

$counties = $state->getCounties();
echo $counties[0]->name; // Alameda

$county = County::fromFips('06037');
echo $county->name; // Los Angeles
echo $county->getState()->name; // California