Skip to content

ZIP lookup

You can use the function ‘taxNamesForZip’ to get an array of suggested tax names for the employee:

<?php
include('taxes.php');
$workzip = 10001;
$homezip = 7450;
$taxlist = taxList();
$a = taxNamesForZip($workzip, $homezip);
foreach ($a as $taxname){
$tax = $taxlist[$taxname];
$withheld = $tax->withheld ? 'yes' : 'no';
print "name: $tax->name<br>withheld: $withheld<br>type: $tax->type<br><hr>";
}
?>

Note Federal, FUTA, and Social Security taxes apply regardless of ZIP code, and are not returned by taxNamesForZip().