Washington State Tax Rate Lookup - Free PHP Code!
Only July 1, 2008, Washington State came out with a very simple URL interface for looking up destination tax rates. Below is the PHP code for the PHP class WAXMLParser, which simply takes in the street address, city, and 5-digit zip code of the address you will be shipping your product to, contacts the dor.wa.gov server, reads the XML-based response from the server, and returns the tax information in an array. To use the code, copy it from the text box below, save it as a file, and integrate it into your shopping cart. All we ask for in return is that if you like our code, you add our link to your site (html for the link is in the textbox too).


The Code



Also included in the code is a sample of the way you would call the function to get rate information returned. If you look at the variable $mylookup, it is an associative array that contains all of the information from your tax rate lookup. To get a good idea of what is contained in the array, try adding print_r($my_data);. Now that you have the array of data, you can use it to make calculations, build a report database, or whatever you need for your tax collection purposes.
Programmed by JMH Online Retailers Copyright © 2008 JMH Online Retailers