SHARE
TWEET

Untitled

a guest Dec 13th, 2016 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $username = "sample";
  3. $password = "password";
  4. $zipcode = "90210";
  5. $url = "https://api.zip2tax.com/TaxRate-USA.xml?username=" . $username .        "&password=" . $password . "&zip=" . $zipcode;
  6. $curl = curl_init($url);
  7. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  8. $curl_response = curl_exec($curl);
  9. /*echo $curl_response;*/
  10. curl_close($curl);
  11.  
  12. $curl_response = str_replace("utf-16","utf-8",$curl_response);
  13. $doc = new DOMDocument();
  14. $doc->loadXML($curl_response);
  15.  
  16.  
  17.  
  18. echo $doc->errorInfo->errorMessage[0];
  19.  
  20. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top