Advertisement
Guest User

Untitled

a guest
Dec 13th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement