Used to create lists of countries and US and CA states/provinces.
composer require digital-canvas/options
// US states only
$states = \DigitalCanvas\Options\States::getPairs(['US']);
// US states and CA provinces
$states = \DigitalCanvas\Options\States::getPairs(['US', 'CA']);
// US states only
$states = \DigitalCanvas\Options\States::getArray(['US']);
// US states and CA provinces
$states = \DigitalCanvas\Options\States::getArray(['US', 'CA']);
<select name="state">
<?php foreach(\DigitalCanvas\Options\States::getPairs(['US']) as $abbr => $label):?>
<option value="<?php echo htmlspecialchars($abbr);?>"><?php echo htmlspecialchars($label);?></option>
<?php endforeach; ?>
</select>