Skip to content

taxNamesForZip

A function which returns an array of tax names corresponding to the work and home ZIP codes.

Syntax

value = taxNamesForZip ( $workzip, $homezip )

  • value - A string array result.
  • $workzip - A string indicating the employee's workplace ZIP Code.
  • $homezip - A string indicating the employee's residence ZIP Code.

Example

Get the taxes for an employee based on ZIP codes:

<?php
include 'taxes.php';
$workzip = 20301;
$homezip = 17325;
$txs = taxList();
foreach (taxNamesForZip($workzip, $homezip) as $name){
$tax = $txs[$name];
print "$tax->name\n";
}
?>

Note: Not all jurisdictions can be accurately dilineated using Zip Codes. The taxes suggested by this method represent a “best-guess” selection based on the available facts and rules.

When muliple jurisdictions overlap ZIP Code boundaries, all possible tax names are returned.